Welcome Guest Search | Active Topics | Sign In | Register

Eo.PDF Font-size 62.5% and rems Options
Christian
Posted: Friday, February 28, 2014 7:52:44 AM
Rank: Member
Groups: Member

Joined: 11/6/2013
Posts: 17
I have a problem where I am using

Code: HTML/ASPX
html {
 font-size: 62.5%;
}

and
Code: HTML/ASPX
body > div {
			font-size: 1rem;
		}


This makes 1rem = 10px but not when I make a PDF out of it. Anyone know of this issue? Some scaling that could be the problem or something like that?


I have tried removing the % and go normal but still have the issue. AutoScale/Fit is set to none. The scaling is realsize * 0.75 so if I take a zoom-level of 1.3333333333f it will look correctly.
eo_support
Posted: Sunday, March 2, 2014 10:32:20 AM
Rank: Administration
Groups: Administration

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

The difference is probably because of the screen/PDF DPI values. The default screen DPI value is usually 96, while the default PDF DPI value is 72. The difference is exactly 96/72 = 1.3333. Because of the DPI difference and the fact that Adobe Reader often automatically apply an internal zoom level (You will notice this when you the same PDF at 100% with Chrome Browser's built-in PDF viewer and the standalone PDF viewer. With both setting to 100% zoom level, Adobe Reader's PDF will often be a different size than that of Chrome Browser), the text may appear to be the wrong size. However if you print them out they should have the same size.

Thanks!
Christian
Posted: Monday, March 3, 2014 2:50:22 AM
Rank: Member
Groups: Member

Joined: 11/6/2013
Posts: 17
When I print from chrome the font size is big and nice. When I print with adobe reader it is smaller, the css is exaclty the same and I export to pdf like this:

Code: C#
EO.Pdf.HtmlToPdf.ConvertUrl("c:\\test.html", "c:\\result.pdf", new HtmlToPdfOptions() {
    ZoomLevel = 1, AutoFitX = HtmlToPdfAutoFitMode.None,
    AutoFitY = HtmlToPdfAutoFitMode.None, PageSize = EO.Pdf.PdfPageSizes.A4 
});
Process.Start("c:\\result.pdf");
eo_support
Posted: Monday, March 3, 2014 10:10:17 AM
Rank: Administration
Groups: Administration

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

I am not sure what else to tell you then. We tested the following file:

Code: HTML/ASPX
<html>
<style>
html
{
	font-size: 62.5%;
}

body > div
{
	font-size: 1rem;
}
</style>
<body>
	<div>
		some text
	</div>
	<p style="font-size:10px;">
		some text
	</p>
</body>
</html>


We tried to:
1. Load the file directly in Chrome browser, then print it;
2. Run your code to convert the same file into a PDF file, then print it with Adobe Reader;

The result font size are exactly the same. In fact 10px is a rather small font size. So I do not know why when you print it Chrome your font size is "big and nice". The "normal" font size is 16px. So 10px should not be big, they should be rather tiny.

Thanks!
Christian
Posted: Monday, March 3, 2014 11:08:07 AM
Rank: Member
Groups: Member

Joined: 11/6/2013
Posts: 17
eo_support wrote:
Hi,

I am not sure what else to tell you then. We tested the following file:

Code: HTML/ASPX
<html>
<style>
html
{
	font-size: 62.5%;
}

body > div
{
	font-size: 1rem;
}
</style>
<body>
	<div>
		some text
	</div>
	<p style="font-size:10px;">
		some text
	</p>
</body>
</html>


We tried to:
1. Load the file directly in Chrome browser, then print it;
2. Run your code to convert the same file into a PDF file, then print it with Adobe Reader;

The result font size are exactly the same. In fact 10px is a rather small font size. So I do not know why when you print it Chrome your font size is "big and nice". The "normal" font size is 16px. So 10px should not be big, they should be rather tiny.

Thanks!


Very odd then. When I print it using chrome its well ok its not BIG but it is bigger than when I convert it to pdf, open it in adobe acrobat and print.I printed the two documents and scanned them and here is the screenshot(chrome first, pdf second) :

eo_support
Posted: Monday, March 3, 2014 11:13:58 AM
Rank: Administration
Groups: Administration

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

Can you try different values for HtmlToPdf.Options.AutoAdjustForDPI and see if it makes a difference?

Thanks!
Christian
Posted: Tuesday, March 4, 2014 3:12:50 AM
Rank: Member
Groups: Member

Joined: 11/6/2013
Posts: 17
eo_support wrote:
Hi,

Can you try different values for HtmlToPdf.Options.AutoAdjustForDPI and see if it makes a difference?

Thanks!


No difference in pdf nor printing it out.
Christian
Posted: Tuesday, March 11, 2014 5:45:42 AM
Rank: Member
Groups: Member

Joined: 11/6/2013
Posts: 17
eo_support wrote:
Hi,

I am not sure what else to tell you then. We tested the following file:

Code: HTML/ASPX
<html>
<style>
html
{
	font-size: 62.5%;
}

body > div
{
	font-size: 1rem;
}
</style>
<body>
	<div>
		some text
	</div>
	<p style="font-size:10px;">
		some text
	</p>
</body>
</html>


We tried to:
1. Load the file directly in Chrome browser, then print it;
2. Run your code to convert the same file into a PDF file, then print it with Adobe Reader;

The result font size are exactly the same. In fact 10px is a rather small font size. So I do not know why when you print it Chrome your font size is "big and nice". The "normal" font size is 16px. So 10px should not be big, they should be rather tiny.

Thanks!


What I had not realised before is that adobe acrobat shows the font size in points. That would however mean that if I set font-size to 13 px it would show 10pt, but still it shows 9.75pt with autoadjustfordpi set to false. 16px in browser shows as 12pt which is correct, 14px in browser is 10.5pt in adobe which also is correct according to.

http://reeddesign.co.uk/test/points-pixels.html
eo_support
Posted: Tuesday, March 11, 2014 9:30:07 AM
Rank: Administration
Groups: Administration

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

Yes. Adobe uses points. However regardless what unit it uses when you print it out on paper you should get the same result. Have you found out why the printing results were different for you?

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.