Welcome Guest Search | Active Topics | Sign In | Register

PageImages are blurry Options
Zazzle Inc.
Posted: Wednesday, June 26, 2019 7:01:24 PM
Rank: Newbie
Groups: Member

Joined: 8/1/2018
Posts: 1
Hi, we are trying to use EO PDF to create jpegs (we have some printers that can't handle pdfs)

I am setting GeneratePageImages to true and JpegQualityLevel to -1 but the image that I am getting from PageImages is very blurry. I know that the quality will be lower than the PDF but is there a way to increase the original canvas size or such to get a higher quality image?

If there is not, is there a better way to create a jpeg from the HtmlToPdf.ConvertHtml result?
eo_support
Posted: Sunday, June 30, 2019 4:34:54 PM
Rank: Administration
Groups: Administration

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

You may be running on a high DPI system but your application did not explicitly set to be high DPI aware. As a test, you can try to set your system DPI to standard (100%) and see if that corrects the blurry issue. If that corrects the problem, then it's definitely DPI related. In that case you can try to explicitly set your process to be DPI aware by calling this Windows API:

https://docs.microsoft.com/en-us/windows/desktop/api/winuser/nf-winuser-setprocessdpiaware

For example, in C# you can use the following code to enable this:

Code: C#
using System.Runtime.InteropServices;

static class Program
{
    [DllImport("user32.dll", SetLastError = true)]
    static extern bool SetProcessDPIAware();

    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main()
    {
        SetProcessDPIAware();
		
        ....your other code.....
    }
}


Please note that while this turns on high DPI aware for your application, it may cause problem for your application if your application is NOT truely high DPI aware. EO.Pdf is high DPI aware so it won't have problem with high DPI aware to be on. However other part of your application may not be. In that case your may need to revert your system to normal DPI settings.

Hope this helps.

Thanks!
Lionello Giampaolo PROMETEO SRL
Posted: Monday, February 19, 2024 6:34:51 AM
Rank: Member
Groups: Member

Joined: 11/8/2021
Posts: 21
Unfortunately, we cannot use SetProcessDPIAware.
Are there any other solutions?
Thanks
Regards
eo_support
Posted: Monday, February 19, 2024 11:02:35 AM
Rank: Administration
Groups: Administration

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

No. The root of the blurry image is because the application is not in high DPI aware mode. So the only two ways to resolve this issue is:

1. Change your system DPI to standard; OR
2. Turn on high DPI awareness for your application;

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.