Welcome Guest Search | Active Topics | Sign In | Register

How to customize image loading when converting HTML to PDF Options
Oliver Hanappi
Posted: Thursday, December 11, 2014 9:40:39 AM
Rank: Newbie
Groups: Member

Joined: 8/27/2013
Posts: 5
I am using HtmlToPdf.ConvertHtml to convert HTML to PDF. How can I customize the way images are loaded?

I am aware that there is the property HtmlToPdfOptions.BaseUrl, however I do not want to depend on a web server. My images are stored in a database and I would like to load them from the database based on the image url.
eo_support
Posted: Thursday, December 11, 2014 1:18:44 PM
Rank: Administration
Groups: Administration

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

Generally you should let the web server do the job since internally EO.Pdf runs a "web browser" to load the page, then render it as PDF. The interaction between a web server and web browser are well defined and optimized on both ends. So for example, if you have an image in the database, then most likely you already have some kind of server side code to serve it to a browser since a browser can't talk to you database directly. The best approach to do HTML to PDF conversion would be to rely on the same code.

If you do not want to reply on your web server, you can find possible methods here:

http://www.essentialobjects.com/forum/postsm35769_Image-place-holder.aspx#35764

Thanks!
Oliver Hanappi
Posted: Tuesday, December 16, 2014 4:29:13 AM
Rank: Newbie
Groups: Member

Joined: 8/27/2013
Posts: 5
Thank you for your information. I decided to use Data URIs.
eo_support
Posted: Tuesday, December 16, 2014 9:27:55 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Great. That will work for you too. Please feel free to let us know if there is anything else.

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.