Issue with chart rendering on PDF with Document Generation module
0
Does anyone have experience using Charts in combination with the PDF Generation module? I’m encountering rendering issues. It seems as if the PDF is considered ‘ready’ before the charts on my page have actually finished rendering. As a result, I’m seeing very inconsistent results.Mendix documentation does mention the following:Some widgets, such as Charts, might be rendered inconsistently in the generated PDF due to factors like animation.However, we are not using any animations, yet we still experience issues when generating PDFs. The behavior is highly inconsistent. In one export, for example, a single chart may render correctly while the others remain empty; in another export, a different chart is rendered correctly and the rest are empty; and in some cases, none of the charts are rendered properly at all. There are also instances where all the charts are rendered correctly.I have already added a delay in the Page microflow within the ‘Generate PDF From Page’ action, after showing the page, in the hope that this would provide additional rendering time. Unfortunately, this has had no effect on the outcome.Does anyone have an idea what might be causing this behavior and what a possible solution or workaround could be?This is the digital version of the charts, which renders correctly (titels are hidden on purpose):Here you can see an example of a PDF which is missing the data for one of the two heat maps:0In this example, all the data for the charts are missing in the PDF:
asked
Martijn Muskens
3 answers
2
I was able to resolve the issue by converting the charts to Base64, which then allowed me to convert the Base64 back into an image. I use that image for the PDF functionality, ensuring that it is always rendered correctly.
answered
Martijn Muskens
0
Hi , Just check are you using any css inline or as a file for any coloring , i encounter the same issue which is resolved just writing css in another form .
answered
Vineet Agrawal
0
Could you confirm if your PDF generation is configured to run asynchronously? If not, I recommend enabling asynchronous execution and testing again. This can help ensure the page and charts have enough time to fully render before the PDF is generated.