PDF Export with .timeline_cell CSS

Hi,

I am trying to export gantt chart to PDF with weekend dates marked with grey background.
This works fine when using exportToPDF with RAW: TRUE but we need to use RAW: FALSE and that’s not working.

Is there any way to do this ?

gantt.exportToPDF({
    raw: false,
    header: "<style>" + document.getElementById("styles").innerHTML + "</style>"
});

Template:
gantt.templates.timeline_cell_class = function (task, date) {

          if (date.getDay() === 6) {
                  return "week_end";                
            } else if (date.getDay() === 0) {
                return "week_end";                
            } else {
                return ;
            }

};

CSS:
.gantt_task_cell.week_end {
background: #f2f2f2;
border-bottom: 1px solid #cecece;
border-right: 1px solid #cacaca !important;
}

See example:
https://snippet.dhtmlx.com/0t5jzq0e

Hello Andreas,
When you use the raw: true parameter, Gantt saves the chart as HTML elements and sends it to the export server. With the combination of styles in the header parameter, it is possible to see the same chart in the exported file.

When the raw option is disabled, Gantt only sends the dataset and the gantt.config object. The templates are functions, and there is no way to run custom Javascript code on the export server for security reasons. So, when the data is exported, it works the same way as if you didn’t use the templates. That’s why you need to use the raw mode when you have custom configuration:
https://docs.dhtmlx.com/gantt/desktop__export.html#exportingcustommarkupandstyles