|
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.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
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#35764Thanks!
|
|
Rank: Newbie Groups: Member
Joined: 8/27/2013 Posts: 5
|
Thank you for your information. I decided to use Data URIs.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,196
|
Great. That will work for you too. Please feel free to let us know if there is anything else.
Thanks!
|
|