|
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.
|
|
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.htmlIf 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!
|
|
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.
|
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,217
|
Great. Glad to hear that it works for you!
|
|
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
|
|
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
|
|