3

This might be a common question...but I did not find exact solution to this...

I have a Javascript and AngularJS library that creates a graph, and I need to export the same as PDF. If I try to render the same as PDF, it displays all the page in plain text. No graph is displayed

Any fix for this?

3

The engine that generates PDF in Salesforce does not support JavaScript and neither does the PDF format itself so anything drawn into the page by JavaScript won't make it through to the PDF.

PDFs generated on Salesforce can include images though. Here is an example of that approach for a barcode. The equivalent for a graph would be this Google Image Chart service that returns your chart data rendered into an image. But bear in mind this deprecation notice:

While the dynamic and interactive Google Charts are actively maintained, we officially deprecated the static Google Image Charts way back in 2012. This gives us the right to turn it off without notice, although we have no plans to do so.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.