Welcome Guest Search | Active Topics | Sign In | Register

Print HTML and print PDF Options
serializer
Posted: Friday, November 11, 2022 5:39:58 AM
Rank: Advanced Member
Groups: Member

Joined: 5/9/2016
Posts: 84
I have the "Total package" with EO.PDF and EO.WebBrowser.

I have HTML being shown in EO.WebBrowser. Content is generated mostly through Javascript and the content looks nice in EO.WebBrowser.

But what is the best way (dynamically - not manually) to save the page, exactly as it looks, to PDF and HTML?
eo_support
Posted: Friday, November 11, 2022 9:38:09 AM
Rank: Administration
Groups: Administration

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

To save the page to HTML, you can simply call this method:

https://www.essentialobjects.com/doc/eo.webbrowser.webview.gethtml.html

To get the page as PDF, we recommend you to use a HtmlToPdfSession object:

https://www.essentialobjects.com/doc/eo.pdf.htmltopdfsession.runwebviewcallback_overload_1.html

You can model your code based on the sample code from the above link. The key is you will have access to the underlying WebView object that you can use to load whatever you want to normally load into a WebView. Once you load your desired content, you can then call RenderAsPDF to produce the final PDF file.

Please let us know if this works for you.

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.