Welcome Guest Search | Active Topics | Sign In | Register

ASPXToPDF Options
OleOj
Posted: Tuesday, September 16, 2014 6:46:36 AM
Rank: Member
Groups: Member

Joined: 9/16/2014
Posts: 11
Hi,

We have tested your ASPXToPDF component and we have one show-stopper with it.
We want to use it to create a PDF from some pages that contains tables and graphs. We have been using Telerik for years and we discovered that there is problems with how you render their HtlmGraph (HTML5). The bars in the graph does not have the correct size.
I have created a little test project using their demos if you want me to give that to you. Just let me know how to do it since there is no possibility to add attachments here.. We really want to buy your product, but we can't display wrong values in the graph. There is also some problems with the sizing of the fonts. You will also see that in the test I have created.
I have also discovered some problems with IE9 saying that it can't open the file if we use "Open", but it works if we saves the file on the client before we open it. In Firefox it works both with open and save. It is not always since it works for some files, but not for other. The ones that works are bigger than the ones that does not work. We plan to go into production October the first this year.

Best Regards
Ole Oscar Johnsen
eo_support
Posted: Tuesday, September 16, 2014 9:23:48 AM
Rank: Administration
Groups: Administration

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

We do not support all HTML5 canvas features. You can follow these steps to send a test app to us:

http://www.essentialobjects.com/forum/test_project.aspx

When you send your test app, please try not to include third party controls such as Telerik. For example, you can try to capture the output HTML and send us the output HTML and all the dependency files (JavaScript, images, CSS, etc). Once we have that, we will run it here and see what we can find. In the mean time, you can look into their graph to see if they can output as SVG. I believe we support SVG better than HTML5 Canvas.

Also when you say IE 9 can't open it, do you get an error message? Does it happen only on your server or you can reproduce it on your dev machine as well?

Thanks!
OleOj
Posted: Tuesday, September 16, 2014 9:40:59 AM
Rank: Member
Groups: Member

Joined: 9/16/2014
Posts: 11
I have uploaded a project to your support email not including your dlls.
The css, javascript and so on is embedded within the Telerik component as web resources, so it will take me to much time to extract all references and redo them to files.
The IE9 problem happens on multiple computers. When we produce report for a client they have different amount of data. For some it works, and for other it does not.

Regards
Ole Oscar Johnsen
OleOj
Posted: Tuesday, September 16, 2014 10:04:01 AM
Rank: Member
Groups: Member

Joined: 9/16/2014
Posts: 11
IE9 problem, Yes we get an errormessage saying something like "Unable to open file". I will give you the real errormessage when it happens next time.
eo_support
Posted: Tuesday, September 16, 2014 10:43:16 AM
Rank: Administration
Groups: Administration

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

We have not received your test file yet. Please check if your email was sent out successfully.

Thanks!
OleOj
Posted: Tuesday, September 16, 2014 11:28:27 AM
Rank: Member
Groups: Member

Joined: 9/16/2014
Posts: 11
Hi,

I posted it three hours ago and there is no reply that the delivery was unsuccessful. I have now posted a new message to you without run-times. They can be downloaded from the internet.

Regards
Ole Oscar
eo_support
Posted: Tuesday, September 16, 2014 11:55:11 AM
Rank: Administration
Groups: Administration

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

Please try two things:

1. Increase HtmlToPdf.Options.MinLoadWaitTime. Many charts, including Telerik's HTML5Chart, use animations. For example, the bars start short and then "grow" into full length. The converter has no way of knowing when your chart has grown into full length so it might starts conversion before the bars have reached their full length/size. To avoid such issue, you can give HtmlToPdf.Options.MinLoadWaitTime a large value (in ms, for example, 2000), this will give the script more time to run so that by the time the conversion starts, the bars are already at their full size;

2. You may need to set scale factor or use a fixed wide DIV to force a minimum width on the page. By default, the HTML to PDF converter has a much smaller "window width" than a real browser due to the fact that the default "paper width" is much smaller. This can "squeeze" the output and causes undesired result (which you should be able to duplicate using a real browser by using a smaller window width). In order to resolve this issue, you will need to either take advantage of the built-in auto scale feature of the converter, or explicitly set a scale factor. When a scale factor (less than 1) is set, the "browser window" becomes wider. For example, when the output scale factor is set to 0.5, the same paper can fit twice as much contents, thus the virtual browser window width doubles. The easiest way to force an autoscale is to place something like this in your HTML:

Code: HTML/ASPX
<div style="width:1000px;height:1px;"></div>


This will force the converter to auto scale the output so that it can at least fit 1000 pixels horizontally. You can find more details on output scaling here:

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

If those does not solve the problem for you, we will need you to resend us the test project. We are not able to run your test project since we do not have the third party DLLs that you use. You need to include those DLLs that you use in order for us to reproduce the problem here. If you have problems to send them through email, you can try to upload it to somewhere online and then email us the link. We did look into Telerik's Html5Chart demo page and it works fine with our HTML to PDF converter here. Based on what we see from their demo site, they actually generates SVG. So it should work fine with our converter.

Alternatively, you can use Chrome Developer Tool to inspect the DOM tree of your HTML page and copy the SVG output of your chart, then create an HTML that include that SVG directly and see if it renders correctly with our converter. If that duplicates the problem, you can just send us this HTML file instead of sending the whole project.

Thanks!
OleOj
Posted: Wednesday, September 17, 2014 4:41:54 AM
Rank: Member
Groups: Member

Joined: 9/16/2014
Posts: 11
Hi,
Many thanks, The minimum load time did the trick. This looks promising.
The only problem we might have is that since it is running on a server and the amount of data/cocurrent users is variable, we don't know when the "Loading" has finished. Do you have a more safe method to do this or is there any plans of improving it. I don't know and you might have some experience in this since we need to make sure that the bars are correct. We are displaying information that needs to be 100% same as the web page.

I have read your information about the scale factor and I have not done any adjustments to the html to try to fix it. So if you can do some investigations for me on it that would be really appreciated since there still exist some problems with sizing of the text within the graph. I am testing it with ShrinkToFit. I tried to set the minimum load time to 5000, but the same result.
I have now stripped down a new test project that only needs one reference to the Telerik.Web.UI.dll. I will email the test project to you without it and I will find a way to give you a demo version of the Telerik dll for test.

Best Regards
Ole Oscar
eo_support
Posted: Wednesday, September 17, 2014 9:31:27 AM
Rank: Administration
Groups: Administration

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

Please try to set Transitions to false on your HtmlChart:

Code: HTML/ASPX
<telerik:RadHtmlChart Transitions="false" ....>
....
</telerik>


The Transitions property controls whether the chart plays any animation. Once the animation is turned off, the chart should load immediately after the page loads. Thus when the conversion starts, the chart is already ready.

If you still want end users to be able to see the animation when they load the page with a regular browser, then instead of setting it in ASPX, you can set Transitions to false in code immediately before you call RenderAsPDF.

If that still does not resolve the problem for you, you will need to contact Telerik to ask whether they have a client event that is triggered AFTER the Chart has been rendered. If they have such an event, then you can handle that event and then use the manual trigger feature of our converter to trigger the conversion inside that event handler manually (instead of automatically after HtmlToPdf.Options.MinLoadWaitTime). See here for more information about manual trigger (look for "Triggering Conversion Manually"):

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

The zoom factor should not matter. We only mentioned in our original reply because that was a possibility. However if minimum load time fixes the problem for you, then it should be unrelated to zoom factor.

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.