а

Export to PNG not working anymore


#1

Hello,

I’m using the exportToPNG function with GPL License since years but this export doesn’t work anymore. I Have tested on several web browser but the export is still not working. (I’m using the dhtmlx-gantt 4.2.1)

When I call the export function a png is generated with the columns headers but no gantt is printed.
In the bottom of my png file there is the following message : This document is created with dhtmlx library

I Have tested with PDF export but there is the same problem.

Could you tell me if there is an issue about it ?mygantt%20(1)


#2

Hello @Lucas_Tumia,

I tried to reproduce this issue in the gantt “v4.2.1” with the default “export to pdf/png” function:
gantt.exportToPDF(); gantt.exportToPNG();
And export worked correctly, here is a screenshot:

You can try it by yourself in this demo(unpack the archive and open the 06_export.html file):
https://files.dhtmlx.com/30d/03a35d9a29758e75746679b592cda921/dhtmlxGantt_v4.2.1.zip

I can suppose that the issue is connected with your “export function” or “export data”. On your screenshot, it looks like the “export function” returned the file without any data loaded. Unfortunately, I can’t detect the issue without more details.
Could you please provide me a kind of a demo where I will be able to reproduce the issue?

Regarding the “This document is created with dhtmlx library” line:
it is the watermark which is added automatically. You can read about it by the following link:
https://docs.dhtmlx.com/gantt/desktop__export.html


#3

Hello @Siarhei

Thank you very much for your help.

I have tested you project and the export is working fine but I compared your Json data with mine and I noticed a differency : I have an end_date tag in the config and you don’t have this tag.

So I tried to remove it and after that the export was working ! But I don’t understand why the export does not work with this tag which is present since years.

I attach you my Json file, could you tell me if there is something wrong with it (especially with the end_date tag at line 300) ?

Thank you

json.txt (6.7 KB)


#4

Hi @Lucas_Tumia,
Thank you for the data you sent. As I can see, you are using the gantt.config.start_date/end_date config:
https://docs.dhtmlx.com/gantt/api__gantt_end_date_config.html
to set the range of the exported file. For some reason, this config stopped work for the gantt “v4.2.1”.

As a workaround, I can suggest you remove this config from your code to avoid the issue and set up the range inside the export function by “start/end” properties, like in this code fragment:

gantt.exportToPDF({
	start:"27-02-2013",
    end:"30-05-2013",
});

Regards,


#5

Ok thank you very much.

indeed when I remove theese lines the export is working.

As you said, this config stopped work for unknown reason. It’s too bad but it’s working now.

Thank you for your help !