Welcome Guest Search | Active Topics | Sign In | Register

The default text size in PDF is bigger than HTML Options
Jacky
Posted: Tuesday, April 24, 2012 3:01:06 AM
Rank: Newbie
Groups: Member

Joined: 4/24/2012
Posts: 2
I write some html code as below:

Code: HTML/ASPX
<div style="text-align: center;"><font size="2">This word is so beautiful.</font></div>
<div style="text-align: center;">This word is so beautiful.</div>
<div style="text-align: center;"><font size="3">This word is so beautiful.</font></div>


I set the font-size is 2 in the first line and keep the font-size of second line as default.

in the browser, the text in first line looks bigger than the second. but if I convert the html by EO.Pdf.HtmlToPdf.ConvertHtml(), the text in first line looks smaller than the second in PDF.

And the text in second line looks more like the third line (size =3).

Is this a known bug for EO.pdf or I missed something when converting HTML to PDF?

could you guys give me a solution or work around?

by the way, how to upload the screenshot to make the issue clearly?

thanks in advance.
eo_support
Posted: Tuesday, April 24, 2012 6:23:39 AM
Rank: Administration
Groups: Administration

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

This might be something related to your browser. We tested your HTML in IE, FireFox and Chrome, they all have the same result as us.

The HTML standard does not define "default font size". So it can be interprets in anyway a browser sees fit. That's why sometimes you will have the same HTML page rendered differently in different browsers. In such cases our rendering is most close to Google Chrome.

I am not sure what you meant by a "workaround" though. If you want a different font size, you set a different font size. If you want to set a “default font size”, you set it in an outer element. For example, you can put everything inside a DIV and then set font size on that DIV to set the “default size” of the contents inside that DIV.

You won’t be able to upload screenshot in our forum. You have to upload the image to somewhere else and then link to that image from our forum.

Thanks!
Jacky
Posted: Wednesday, April 25, 2012 3:03:14 AM
Rank: Newbie
Groups: Member

Joined: 4/24/2012
Posts: 2
thanks a lot.

let me continue to check my codes further.


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.