Print PDF with Colors of Custom Event Classes

Hi,
I have implemented the Print PDF functionality on a calendar which has custom classes to color-code the background for events based on the “category” which is stored for each event in the DB ( using php connector).

The calendar will print ( using extra PDF code), but the problem is that only some of the “category” classes maintain their color - most print with no color background.

Is there a way to pass these through the PDF code so that the generated PDF will maintain these colors when printed?

Custom CSS classes:

.dhx_cal_event.casting div{background-color:#bca7f9} .dhx_cal_event_line.casting{background-color:#bca7f9} .dhx_cal_event_clear.casting{background-color:#bca7f9} .legend li.casting {background-color:#bca7f9} .dhx_cal_event.other div{background-color:#ffcc66} .dhx_cal_event_line.other{background-color:#ffcc66} .dhx_cal_event_clear.other{background-color:#ffcc66} .legend li.other {background-color:#ffcc66} .dhx_cal_event.deadline div{background-color:#fbee58} .dhx_cal_event_line.deadline{background-color:#fbee58} .dhx_cal_event_clear.deadline{background-color:#fbee58;} .legend li.deadline {background-color:#fbee58}

My scheduler js code with custom classes for event categories:

scheduler.templates.event_class=function(start,end,event){ switch ( event.category ) { case "4" : return "casting"; case "5" : return "other"; case "6" : return "deadline"; case "0" : return "unassigned"; } }

I’m using the latest scheduler codebase (2.3) and PDF code from the DHTMLX site. You can see from this test page http://app.picrow.com/prod_cal_test.php that only the “other” events are colored.

Also, is there a way to get the HTML Escape Characters converted back when printing? For example, if the event text contains “&”, the web page outputs the escaped chars “&” which is fine, but the PDF prints “&”

Many thanks for your help!

Hello,

It looks like the link is broken.
I’ve tried to use your styles locally — they were exported to PDF correctly (check attachment).

To process html-entities modify pdfGenerate.php file like here:
Replace

private function strip($param) { if ($this->strip_tags == true) { $param = strip_tags($param); } return $param; }
with

private function strip($param) { if ($this->strip_tags == true) { $param = strip_tags($param); } $param = html_entity_decode($param); return $param; }
Best regards,
Ilya