Welcome Guest Search | Active Topics | Sign In | Register

Update to latest EO.PDF, font much smaller Options
Pim
Posted: Tuesday, May 10, 2016 2:59:19 AM
Rank: Newbie
Groups: Member

Joined: 6/23/2015
Posts: 3
I'm testing the update of EO.PDF from 2014 (6.0.36.2) to 2016 (16.0.78.0). When I want to convert HTML to PDF the same text is rendered much smaller (around half the size of the original).
I've done no changes in the code (besides changing the license key). Reverting back to the old version restores the font size.

The HTML is (as a test) very simple: <p>This is a test</p>.

Are there any changes how the new render engine works with (default) fonts and what are these changes, so I can revert these?
Our customers are using a very much amount of different of documents to convert to PDF, so changing the content of a document is not possible, besides (for example) adding some default css when calling ConvertHtml().

Edit:
While testing furthermore, this bug (?) is introduced in version 2016.0.24. In Version 2016.0.21 a bug was introduced with an invalid page size, which was fixed in 2016.0.24. Since this version the default font is half the size. Version 2016.0.17 and 2016.0.21 are still normal (where in 2016.0.21 the pagesize (A4) is not used).

eo_support
Posted: Tuesday, May 10, 2016 3:08:42 PM
Rank: Administration
Groups: Administration

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

Please try to set HtmlToPdf.Options.ZoomLevel to 1. The default value for this property was changed from 1 to 0.6 to accommodate modern web pages that are usually much wider than the default paper width (thus a lower zoom level is needed to fit the whole page). Some page such as yours would display well even on smaller window size, those page will be rendered smaller. You can try to set zoom level back to 1 to revert to the previous behavior. So please try that and see if it resolves the issue for you.

Thanks!
Pim
Posted: Tuesday, May 10, 2016 4:34:55 PM
Rank: Newbie
Groups: Member

Joined: 6/23/2015
Posts: 3
Thank you for your response. This solved the issue! Fontsize is normal now!
It introduces another (little) issue however: the margins on the sides are smaller now (about 2mm less when originally set to 19mm, so approx 17mm margin), compared to the previous version.

Page size and margins are set as follows:

Code: Visual Basic.NET
Dim pageSize As System.Drawing.SizeF = EO.Pdf.PdfPageSizes.A4

' Need landscape? Flip sizes
If Not Me.IsPortrait Then
	pageSize = New System.Drawing.SizeF(pageSize.Height, pageSize.Width)
End If

' These margins are all 19 mm
Dim marginLeft As Single = InchFromMM(Me.LeftMarginMM)
Dim marginRight As Single = InchFromMM(Me.RightMarginMM)
Dim marginTop As Single = InchFromMM(Me.TopMarginMM)
Dim marginBottom As Single = InchFromMM(Me.BottomMarginMM)

Dim pageWidth As Single = pageSize.Width - marginLeft - marginRight
Dim pageHeight As Single = pageSize.Height - marginTop - marginBottom

pdfOptions.PageSize = pageSize
pdfOptions.OutputArea = New System.Drawing.RectangleF(marginLeft, marginTop, pageWidth, pageHeight)


Private Function InchFromMM(ByVal dblMM As Double) As Single
	Return CType((dblMM / 10) / 2.54, Single)
End Function


Settings the AutoAdjustForDPI on False and/or AutoFitX/Y to None doesn't solve it.

Any ideas on this?

Thank you!

Edit: Never mind. After changing back and forth with old and new versions it only changes by 1 or 2 pixels at the top margin, but when printing the document is exact the same.
eo_support
Posted: Wednesday, May 11, 2016 7:15:39 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Great. Thanks for the update and glad to hear that the printing result is the same. The 1 or 2 pixels offsets are probably introduced by rounding errors due to sub pixels rendering.


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.