Welcome Guest Search | Active Topics | Sign In | Register

HtmlToPdfOptions.JpegQualityLevel Options
Anthony West
Posted: Friday, May 18, 2018 5:15:38 PM
Rank: Newbie
Groups: Member

Joined: 9/8/2017
Posts: 2
Hi,

I am using the latest EO.pdf (18.1.75.0). The previous version being used was 17.2.43.0. I noticed in the change log, for version 18.0.9, it says, "Added support for HtmlToPdfOptions.JpegQualityLevel to be set to negative value to skip JPEG compression for images".

I have set JpegQualityLevel to -1 (also tried -2) and it seems to be the same as setting the quality to 100. The original files are png images. Is this expected behavior? Jpegs, by nature, are not the best at representing simplistic images (such as ASP.net charts), but is there anything that can be done to get a better png-to-jpeg conversion?
eo_support
Posted: Monday, May 21, 2018 11:36:17 AM
Rank: Administration
Groups: Administration

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

Setting JpegQualityLevel to -1 does not automatically improve image quality. What it does is to skip JPEG compression. The images are stored in bitmap in memory (no matter what the source format is, it is decoded into a bitmap first), when it is rendered to a PDF file, by default it will go through a JPEG encoder to save space. JpegQualityLevel is one of key parameter for this step. If you set to -1, then it is completely skipped and usually results in a larger file.

Thanks!
Anthony West
Posted: Monday, May 21, 2018 11:50:25 AM
Rank: Newbie
Groups: Member

Joined: 9/8/2017
Posts: 2
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.