Welcome Guest Search | Active Topics | Sign In | Register

The Font in PageImages is not clearly Options
CHIEN
Posted: Thursday, September 5, 2013 7:24:45 PM
Rank: Member
Groups: Member

Joined: 9/4/2013
Posts: 18
Dear EO Team,

We are testing use EO.PDF convert HTML to JEPG, but we just found out the text in JPEG is blur.
I guess it may be some kind of image resolution problem , but I can't figure out how to set image resolution?

HTML show in browser


Blur Font in JPEG


HTML :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div>
Hello World.<br />
<span style="font-size:2em">Hello World.</span><br />
<span style="font-size:4em">Hello World.</span>
</div>
</body>
</html>

Code:
HtmlToPdfResult result = HtmlToPdf.ConvertUrl("http://localhost//fusion.aspx", "c:\\fusion.pdf");
System.Drawing.Image pageImage = result.PageImages[0];
pageImage.Save("c:\\fusion.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

Can you make the text in JPEG as clear as in the browser?

Thank you
eo_support
Posted: Thursday, September 5, 2013 7:36:53 PM
Rank: Administration
Groups: Administration

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

That's normal and there is no way to make it looks as sharp as on screen. The text are in vector format when rendered into the PDF file. However when you generate page images, they will be flatted out as bitmap. The PDF file will always produces the best quality because it can be zoomed out infinitely without loosing quality. This is one of the most important reason why PDF was very popular at the very first place.

When Windows renders text on the screen, it does a lot of optimizations based on the vector font data and the screen resolution. However this process does not occur when the text is rendered into a bitmap (in fact it's the same function, it's just the target device is different). So when you render text into a bitmap, you lose both advantages: vector data and optimizations for screen, which results in lower quality output. As such for the best output quality, you would want to just use the PDF files.

Thanks!
CHIEN
Posted: Thursday, September 5, 2013 7:49:33 PM
Rank: Member
Groups: Member

Joined: 9/4/2013
Posts: 18
Thanks for your answer , now i understand why font is blur.

Thank you very much.
eo_support
Posted: Thursday, September 5, 2013 7:57:26 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
You are very welcome. Please feel free to let us know if you have any more 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.