Welcome Guest Search | Active Topics | Sign In | Register

Font difference on Azure hosted instance Options
Vlatko
Posted: Tuesday, December 12, 2023 3:56:20 AM
Rank: Newbie
Groups: Member

Joined: 12/12/2023
Posts: 6
We are currently experiencing some issues with generated PDF files (converted from HTML) on azure hosted instance. It appears that the font-size in the PDF file is bigger than what font-size is locally, hence breaking some styling from document.

Any possible issues that we can investigate?
Can provide additional information if needed.
eo_support
Posted: Tuesday, December 12, 2023 10:36:34 AM
Rank: Administration
Groups: Administration

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

This can occur if the server and local machine has different DPI settings which would result in different pixel size of the result PDF page. You can try to set this property to true and see if it resolves the issue for you:

https://www.essentialobjects.com/doc/eo.pdf.htmltopdfoptions.autoadjustfordpi.html

If that still does not work, you can try to force your HTML to have a minimium pixel width by adding something like this to the begining of your HTML:

Code: HTML/ASPX
<div style="width:1000px;height:1px;"></div>


This creates an invisible 1 pixel height but 1000 pixel wide area at the top of the page thus force the page to have a minimium width of 1000 pixels.

Please let us know if this works for you.

Thanks!
Vlatko
Posted: Wednesday, December 13, 2023 8:52:43 AM
Rank: Newbie
Groups: Member

Joined: 12/12/2023
Posts: 6
Thanks for quick reply.

We did change the AutoAdjustForDPI property to true, and local environment is now the same as cloud hosted. Was hoping that cloud hosted would reflect local, but this is a good start in any case. It appears they are just 1 pixel larger. Thanks again for the help.
eo_support
Posted: Wednesday, December 13, 2023 9:51:18 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
Great. Glad to hear that it works for you!
Vlatko
Posted: Friday, December 15, 2023 6:51:26 AM
Rank: Newbie
Groups: Member

Joined: 12/12/2023
Posts: 6
So it seems today we are back to it, local environment is no longer the same as cloud env.
What could cause this, because yesterday both were the same
eo_support
Posted: Friday, December 15, 2023 11:28:14 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,217
There are many factors that can affect the automatically detected zoom factor. This is similar to the fact that your page will show different layout if you load it into a browser on different systems with different screen resolution/browser window size. For that reason most pages are designed to adapt well based on different browser window size (Responsive Design). If your page can not adapt well for such differences, the easiest way is for you to force a fixed zoom factor. You can either use the hidden DIV method mentioned in our previous reply, or explicitly set HtmlToPdf.Option.ZoomLevel:

https://www.essentialobjects.com/doc/eo.pdf.htmltopdfoptions.zoomlevel.html


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.