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. Image for the cookie policy date
close icon

Convert html to pdf with AJAX control

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

3 Replies

GM Geetha M Syncfusion Team January 20, 2009 12:18 PM UTC

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



UB Ubonwan January 21, 2009 03:26 AM UTC

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


GM Geetha M Syncfusion Team January 21, 2009 12:26 PM UTC

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


Loader.
Live Chat Icon For mobile
Up arrow icon