We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

problem with image size and file png in HtmlConverter

Thread ID:

Created:

Updated:

Platform:

Replies:

98039 Jan 27,2011 08:53 AM UTC Mar 22,2011 03:51 AM UTC ASP.NET Web Forms (Classic) 8
loading
Tags: PDF
marco
Asked On January 27, 2011 08:53 AM UTC

hello,
I'm using an HtmlConverter (FromString method )in a web service to trasform an html string to pdf (Syncfusion version: 8.3.0.21).
visual studio 2008 and framework 3.5

The images are saved in database and loaded in html with a custom asmx handler
These are the namespaces i use in my project
Imports Syncfusion.Pdf
Imports Syncfusion.HtmlConverter
Imports Syncfusion.Pdf.Graphics
Imports Syncfusion.Pdf.Interactive
Imports Syncfusion.Pdf.HtmlToPdf
Imports Syncfusion.Compression
Imports Syncfusion.Core
and this is a fragment of my html:


New Document






test png







1.When i try to render the html with PNG's in it as a metafile no images appear.
but the png is not rendered even when not using the handler but uri such as


2.gif,jpg and jpeg often are not rendered in the correct size




Priyadharshini J [Syncfusion]
Replied On January 31, 2011 08:34 AM UTC

Hi marco,

Thank you for your interest in syncfusion products.

We are not able to reproduce the issue while html string with png, gif and jpg image in it is not properly rendered. I have placed a simple sample for the same in the location below:
Html to pdf(Html String)14949383871505149555.zip

Kindly try this and also could you please provide us the image with which the issue is reproduced. This will help us a lot in further investigation.

Please let us know if you have any queries.

Regards,
Priyadharshini.



fpacchia
Replied On March 15, 2011 04:18 PM UTC

I have the same problem in a WebForm with HtmlConverter and the attachment shows what happen in PDF file.

Thank You
Fabrizio




test_4bde2028.zip

Geetha M [Syncfusion]
Replied On March 16, 2011 04:58 AM UTC

Hi Fabrizio,

Thank you for the details.

HTMLConverter makes use of WebBrowser control to convert HTML to Image. The problem of image missing can occur if the webpage is converted before it is fully loaded. We have added a new property 'HtmlConverter.AdditionalDelay' so that image conversion process could wait until the HTML is fully loaded. This property is available in our latest public release v9.1.0.20.

Could you please try with this version and let us know if you still reproduce the problem?

Regards,
Geetha


fpacchia
Replied On March 16, 2011 02:27 PM UTC

Hi Geetha,

I tried with latest public release v9.1.0.20. I putted HtmlConverter.AdditionalDelay = 5000 and the browser really wait for 5 seconds before create PDF, but the results in the PDF still remain the same.

Regards
Fabrizio



Geetha M [Syncfusion]
Replied On March 17, 2011 07:58 AM UTC

Hi Fabrizio,

Thank you for the details.

I am afraid that I am not able to reproduce the problem. Could you please modify the below sample so that I can check and get back to you?

F98039472055379.zip

Regards,
Geetha


Jean-Claude Quenaon
Replied On March 18, 2011 07:42 PM UTC

Already got this problem with version 8, very hard to reproduce but existing... I waited for solution from SyncFusion, as i can see is the delay property added to the component...


fpacchia
Replied On March 21, 2011 11:43 AM UTC

I Solved my problem!
The delay isn't the solution, but the path of png image.
I added the "Server.MapPath" before the name of the page Html to convert like this:
.....
"using (HtmlToPdfResult result = html.Convert(Server.MapPath("~/test2.html"), ImageType.Metafile, (int)width, (int)height, dimension))"
.....

In the Html file already rendered, i have:
....

...

The "image" folder must be visible by the Html page rendered.

Regards
Fabrizio




Geetha M [Syncfusion]
Replied On March 22, 2011 03:51 AM UTC

Hi Fabrizio,

Glad to hear that the problem is resolved.

Please let us know if you have any other questions.

Regards,
Geetha


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;