Welcome Guest Search | Active Topics | Sign In | Register

EO PDF and SVG Options
James
Posted: Tuesday, August 7, 2012 10:33:29 AM
Rank: Newbie
Groups: Member

Joined: 8/7/2012
Posts: 1
When generating a PDF from a page with SVG (highcharts) I have discovered a problem (using HtmlToPdf.ConvertUrl(string, Stream)).

I've never had this problem before, and it is only with these 2 charts (there are many other SVG-based charts in this document for example).

Here is a snippet of the page in a browser:



And here is the PDF:



Any help would be much appreciated.
eo_support
Posted: Tuesday, August 7, 2012 11:05:05 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Can you send us the svg file that you are trying to convert? We will take a look and see what we can find. We will PM you as to where to send.

Thanks!
eo_support
Posted: Wednesday, August 8, 2012 8:30:09 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

Please try to set HtmlToPdf.Options.MinLoadWaitTime to a larger value. For example:

Code: C#
//Instruct the Html to PDF converter to wait for to seconds
//before trying to convert the page
HtmlToPdf.Options.MinLoadWaitTime = 5000;

//Convert the page
HtmlToPdf.ConvertUrl(.....);


The reason that only part of your SVG chart is shown is because your SVG chart has an animation effect. The animation "grows" your chart from left to the right. So if the animation takes 3 seconds to play and the converter converts it at 1.5 second, then part of the chart won't show.

The converter does not when the animation is done. There are three ways to handle this situation:

1. Turn off animation on your svg chart;
2. Increase HtmlTopdf.Options.MinLoadWaitTime;
3. Use manual trigger to trigger the conversion:

http://www.essentialobjects.com/doc/4/htmltopdf/eo_js.aspx

Look for "Triggering conversion manually".

Option 3 is the most accurate way however it requires you to put in additional code to notify us when your page is ready to be converted. Option 2 would make the conversion longer because the converter may just unnecessarily wait longer than needed. Option 1 would turn off the animation effect all together, however if you can turn on/off animation based on JavaScript, you can add JavaScript code to check whether you are running inside our converter, then only turn it off when you are inside our converter.

Hope this helps. Please feel free to let us know if you have any more questions.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.