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.

Convert html to pdf with AJAX control

Thread ID:

Created:

Updated:

Platform:

Replies:

79076 Jan 20,2009 02:07 AM Jan 21,2009 07:26 AM Windows Forms 3
loading
Tags: PDF
Ubonwan
Asked On January 20, 2009 02:07 AM

Hi,

I have problem when try to convert html to pdf file (my html file contain ajax control).
The problem is the part it should display image that merge from ajax control when convert to pdf file the image didn't display as you can see in my attachment file , the above image is from pdf file and the below image is from html file how to fixed this problem.
By the way, I use Syncfusion 5.1.1.0




ajaxControl_125572.zip

Geetha M [Syncfusion]
Replied On January 20, 2009 07:18 AM

Hi,

Thank you for the details.

Could you please send me your HTML page so that I could recreate and find the cause of the problem?

Regards,
Geetha


Ubonwan
Replied On January 20, 2009 10:26 PM

Hi Geetha,

Sure, my attachment contain file.html page and file.mht. I use .html page for convert to pdf file as you can see, at first time I think the part that should be display image request from WebResource.axd... but when I generate this html page there is no WebResource.axd file so that why the image didn't display.
Afther that I try to save page with .mhtml and then use it convert to pdf then the pdf file display it is empty page I don't know how to solve this problem please help.


This is code that I use for generate html file from currentUrl :

previewBrowser.Navigate(currentUrl, ref nullObject, ref nullObjStr, ref nullObjStr, ref nullObjStr);

while (previewBrowser.ReadyState != SHDocVw.tagREADYSTATE.READYSTATE_COMPLETE)
Application.DoEvents);

exportStream = new StreamWriter(tempHtlm);

html = ((mshtml.HTMLDocumentClass)previewBrowser.Document).body.outerHTML;
html = metaTag + html;
exportStream.Write(html);
exportStream.Close();

Adn then convert html to image:
HtmlConverter htmlC = new HtmlConverter()
Image metaFile = htmlC.ConvertToImage(tempHtlm, ImageType.Metafile)

I hope you understand my English.



Temp_4469ae94.zip

Geetha M [Syncfusion]
Replied On January 21, 2009 07:26 AM

Hi,

Thank you for the details.

I am able to see that the html page you sent itself displays with cross mark instead of the image. So the generated PDF file will also be like the same.

Please let me know if you have any 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.

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.

;