Export PDF and images

Hi,

I have an event text formated like this :

scheduler.templates.event_bar_text=function(start,end,event){ var text; var format1=scheduler.date.date_to_str("%H:%i"); text="<img src='../../assets/img/categorie/eye.png' height='16' width='16'/>"+" "+format1(start)+"-"+format1(end)+" <b>"+event.text+"</b>"; return text; }

It display an image before the real text.
It work properly when displaying the schedule on screen but when i want to export it in PDF, the images are not shown.

Any idea to display these images when i export in pdf ?

Hi,
the exported html of the scheduler is deployed in export service in order to capture the image. So if your html has inline images with relative paths - this images can not be loaded by the service.

Try specifying full urls in your template, i.e. with the host name and protocol:[code]scheduler.templates.event_bar_text=function(start,end,event){
var text;
var format1=scheduler.date.date_to_str("%H:%i");

var url = location.origin + "/assets/img/categorie/eye.png";
 //location.origin contains the site url - 'http://sitename.com', or 'http://localhost'

text="<img src='"+url+"' height='16' width='16'/>"+" "+format1(start)+"-"+format1(end)+" <b>"+event.text+"</b>";
return text;

}[/code]
Note that if the specified urls are not available from the global internet (e.g. when you running site from localhost), export service won’t be able to retrieve the images

I’ve tested your solution
My images have now absolute path

but it doesn’t work better…

For info, i’m not using the online pdf export but instead, i use this : docs.dhtmlx.com/scheduler/pdf_v4.html

Unfortunately standalone export tools docs.dhtmlx.com/scheduler/pdf_v4.html does not support printing of custom html content, such as images. These tools generate PDF documents based on scheduler structure sent from the client (usually - sizes, text content and optionaly colors of events), so they have limited capabilities in displaying page content.

You may try modifying client-side and server-side (the package of pdf tool should contain the sources), in order to add such functionality for your project.

My previous answer was related to new online export service docs.dhtmlx.com/scheduler/pdf.html

I’ve tested the online version of export pdf and i have 2 problems :

  • i have always “Created with DHTMLX : dhtmlx.com” on footer. It’s not very clean for a professionnal solution. Is it possible to delete it ?

  • when the scheduler (timeline view) is highter than one page, my scheduler is truncated and i don’t have a second page. So i miss any informations. Any solution ?

And i have a third problem : in the generated pdf, the events colors (background colors) a not displayed. All the events à in blue.