This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Problems with printing svg content

StudyPortals wrote on 2016-02-03:
Hi there,

We have been using your PDF printing functionality for quite a while already to render reports for our clients. We recently added some new report views to the page which off course should be printed.
These graphs are svg files which are rendered into the page, but they just won't show up on the PDF we get from your service. I read through the forum and seen you posting replies saying "Pdfcrowd does not support inline <svg>. We support external (linked) SVG files and dynamic SVG generated by JavaScript". Since we render our svg with JS (Chartist.js to be precise) you service should support our page.

Since we are at the end of our debug possibilities I will need some help in finding the exact problem. Could you tell me what the problem is in this page?
It involves the svg's on the bottom of the page.

Kind regards,
Danny Peeters
StudyPortals
support wrote on 2016-02-04:
Hello Danny,

The charting library loads the data dynamically via ajax which, unfortunately, doesn't work reliably with our converter.

If there is an option to render the chart data inline into the page (instead of loading it via ajax), it should resolve the problem.
StudyPortals wrote on 2016-02-09:
That's far from a satisfactory answer...

As I already mentioned, we were using your service for quite a while now and it has ALWAYS worked with AJAX. The parts that do load are also loaded via AJAX and have worked for years, without a problem. And the funny thing is, the missing graphs actually show up a lot sooner than the graphs and tables that were already working for a long time.

There has to be a reason why these graphs don't show up, and since I have no insight in your API, I need you guys to tell me what errors we get so I can fix them.

Looking forward to your reply.

Regards,
Danny
support wrote on 2016-02-11:
Hello Danny,

Some background: Our converter tries to determine the moment when a document is loaded completely. This is not a trivial task if you consider the dynamic nature of today's web pages. It may happen that our software starts printing to PDF prematurely before some parts of the page are ready/loaded/rendered. Namely, setTimeout(), ajax calls, animations, etc do not work reliably with our software in this regard.

I checked your page again and can confirm that our software starts printing to PDF before the missing charts are rendered by the HTML page. There were no changes to this functionality on our side. If this worked for your before, did you make any changes on your side recently?

As I wrote in the previous post, if there is an option to render the chart data inline into the page (instead of loading it via ajax), it should resolve the problem.
StudyPortals wrote on 2016-02-12:
Yes, we made recent changes, we added new graphs which just don't show up. This is the entire reason for contacting you guys.

But I have a feeling we are not going to come to a satisfactory answer here other than that your converter will be of no use for us if we want to continue expanding our web app, which is a shame.
I'll be looking for another API that does support modern web apps.

Kind regards,
Danny