Welcome Guest Search | Active Topics | Sign In | Register

Font size queries Options
Rob
Posted: Tuesday, May 19, 2015 4:00:51 AM
Rank: Newbie
Groups: Member

Joined: 5/19/2015
Posts: 4
We are using EO.PDF HtmlToPdf to render a web page out to a PDF using a stylesheet to control formatting.

The output PDF ignores the font-size and we cannot determine why.

The options used are

HtmlToPdf.Options.PageSize = New SizeF(PdfPageSizes.A4.Width, PdfPageSizes.A4.Height)
HtmlToPdf.Options.OutputArea = New RectangleF(0.4F, 0.4F, 7.4F, 10.0F)
HtmlToPdf.Options.SaveImageAsJpeg = False
HtmlToPdf.Options.PreserveHighResImages = True
HtmlToPdf.Options.FooterHtmlPosition = 10.8
HtmlToPdf.Options.FooterHtmlFormat = "<div style='text-align:center'><img src='" & companyrow("pdffooter") & "' alt='Footer' /></div>"

We are pretty much trial and error but any help on the font-size would be appreciated as this is the common problem we are having.

Thanks
eo_support
Posted: Tuesday, May 19, 2015 10:32:12 AM
Rank: Administration
Groups: Administration

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

The header/footer area does not share the stylesheets for the main contents. The header/footer are actually a separate "document" by themselves. So you will want to use inline styles with them.

Thanks!
Rob
Posted: Thursday, May 21, 2015 4:23:35 AM
Rank: Newbie
Groups: Member

Joined: 5/19/2015
Posts: 4
It's the entire document that ignores the font-size. We've tried in pixels and point sizes. The same HTML in a browser does indeed honour the font size.

The stylesheet is in use as other changes are always picked up. All in all the product is excellent.

Thanks
eo_support
Posted: Thursday, May 21, 2015 11:36:03 AM
Rank: Administration
Groups: Administration

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

Please check:

1. Whether the font is installed on the server. EO.Pdf runs on your server, not on your client browser machine. So very often a font displays fine on the client's machine because the client machine has the font, but does not render fine on the server because the server does not have that font;
2. If the font is already installed on the server, please try to turn the server's UAC off, we have received reports in the past that UAC would prevent us from reading the font data even if it's installed (we do not know why), so turnning it off might help;
3. If both fails, then you can use CSS font-face to load the font directly from the server. That is supported in the latest version. If you use this option, you do not need to install the font on the server;

Hope this helps. Please let us know if it resolves the issue for you.

Thanks!
Rob
Posted: Thursday, June 4, 2015 10:03:39 AM
Rank: Newbie
Groups: Member

Joined: 5/19/2015
Posts: 4
I've tried everything I can think of now, since this is in development i am using local IIS so my pc is the client and the server, i'm an admin and UAC is actually disabled because the popups from Windows are infuriating.

In the browser print dialog the page is laid out perfectly but because the PDF render seems to use a much smaller font it looks wrong. I can increase the font size to say 30pxx just to be outrageous and both the browser and the PDF increase in font size however the print outs still do now match up as the PDF is still a smaller font size than the browser. I'm not sure why this would be yet. Any more ideas i'm willing to try
eo_support
Posted: Thursday, June 4, 2015 4:32:14 PM
Rank: Administration
Groups: Administration

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

I am not exactly sure if I understand your question correctly. There are two totally different things: font family and font size. A problem with font family is the font is not being loaded/used correctly. For example, text that should have been in font A is rendered as using font B. This is what our original reply is about.

Font size is a totally different issue. By default our converter will automatically resize your output in order to fit the paper. So most of the time, the font size in the PDF will not match the actually font size on screen. This is because by default a PDF page is much narrower than a screen, so the page must be zoomed out in order to avoid being cut off. We do offer various options for you to fine control this zooming process:

http://www.essentialobjects.com/doc/4/htmltopdf/auto_fit.aspx

In your case, you can try to set HtmlToPdf.Options.AutoFitX and AutoFitY to None and see if that changes anything. If it does, then you can look into various options and see which combination will give you the desired result.

Please feel free to let us know if you still have any questions.

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.