New ExportToPdf and MarkedTimespans?

Is it possible to print the CSS colored MarkedTimespans with the new ExportToPdf() ?

Yes, you need to provide link for the used css file though.
Something like next

scheduler.exportToPNG({ header:"<link rel='stylesheet' href='http://docs.dhtmlx.com/scheduler/samples/common/custom.css' type='text/css' title='no title' charset='utf-8'>" });

where header contains link to the used css file ( that must be full http link, not the local reference )

I’ve a custom style specified in the exportToPNG function, but the MarkedTimespans are not printed. The CSS is applied to the events, but not to the MarkedTimespans.

Do you have a working sample/demo?

Works for me
docs.dhtmlx.com/scheduler/sample … tyles.html

Beware - if you are using some images for backgrounds, they must have full http path also ( or you cam embed directly in CSS )

I don’t understand why it isn’t working here :frowning:

Demo: dimas.byethost15.com/demo/demo.html (but print button is top-right).

As you can see I add the MarkedTimespans as:

scheduler.addMarkedTimespan({ start_date: dinici, end_date: dfinal, css: "highlight_groc", sections: { timeline_week: necessitatID, timeline_day: necessitatID }, type: "forat" });

And the export function as:

scheduler.exportToPNG({ name: nom, header: "<style>\n\ .highlight_groc { background-color: #FFE097; opacity: 0.50; border: 1px dashed #B5B5B5; box-sizing:border-box !important; }\n\ .dia_avui { background-color: #FFEDE1; }\n\ .dhx_cal_event_line.ev_residents { background-color: #C3FF69 !important; color: black !important; }\n\ .dhx_cal_event_line.ev_altres { background-color: #FF9933 !important; color: black !important; }\n\ .dhx_cal_event_line.ev_contracte { border: 1px solid #FF002F; }\n\ .dhx_cal_event_line.ev_readonly { opacity: 0.5; cursor: default; }\n\ </style>" });

Problem confirmed and fixed.
Be sure to update api.js

I updated the api.js from here: export.dhtmlx.com/scheduler/api.js

But it isn’t working yet? dimas.byethost15.com/demo/demo.html

Please try to update it one more time, must work for sure now.

It’s working now, thx!!