Home Unanswered Active Tags New Question

Printing Event Background

I'm testing the free version at the moment before taking the plunge.

I've edited the source a little to allow events to have different colored backgrounds on screen.
Most browsers default to not printing background colors or images, therefore when printing a calendar, the calendar hour lines show through the Event DIV which makes the whole thing look untidy and unclear.

Is there an easy way to fix this other than asking users to change their browser options?
Asked by steve65 4 years ago.
Replies
I've just tried print preview in FF2 and IE7. While Firefox output is not so bad, IE does exactly what you describe.

The problem is that DayPilot was not designed to be printable. I think it would be better to have a special DayPilot control that would be printer-friendly (otherwise it's like designing for at least three other "browsers" - IE6/7 and FF print previews).

The white background might be created using a white 1x1 pixel image stretched on an underlying div (... not so easy). That's what I would probably try first.
Comment posted by Dan Letecky 4 years ago.
Thanks for your reply, I've tried quite a few solutions without success but I think I've finally settled on the following

in the daypilotcalendar renderevent function
I added
output.AddStyleAttribute("border-left", "1px solid " + stringFromColor(EventBorderColor));
output.AddStyleAttribute("border-right", "1px solid " + stringFromColor(EventBorderColor));
output.AddStyleAttribute("border-top", "1px solid " + stringFromColor(EventBorderColor));
output.AddStyleAttribute("border-bottom", "1px solid " + stringFromColor(EventBorderColor));

I then removed
divFix.AddStyleAttribute("border-left", "1px solid " + stringFromColor(EventBorderColor));
divFix.AddStyleAttribute("border-right", "1px solid " + stringFromColor(EventBorderColor));

This gives each event a better defined border when printing in ie6/7 and firefox, so the hourlines showing through are not such an issue.

Let me know if you think that breaks anything else.
Comment posted by steve65 4 years ago.
This should work fine. You just need to keep margin-top set to 1px and height set to 2px less than full height. You can even remove

output.AddStyleAttribute("background-color", stringFromColor(EventBorderColor));

from the main DIV definition.
Comment posted by Dan Letecky 4 years ago.

Since DayPilot Pro 4.9, printing is supported for DayPilotCalendar through PNG/JPG/GIF export:

Answer posted by Dan Letecky 3 years ago.
New Reply
This reply is
Your name (optional):

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java