Welcome Guest Search | Active Topics | Sign In | Register

HtmlToPDF - Image Quality of Google Map Lacking Options
Matt P.
Posted: Thursday, September 8, 2016 12:22:49 PM
Rank: Newbie
Groups: Member

Joined: 9/7/2016
Posts: 2
When rendering a PDF of my page that contains a Google map, the marker images are blurred. I have set jpeg quality to 100. What am I missing?

This shows the difference:
https://i.imgsafe.org/1902b428ce.png
eo_support
Posted: Thursday, September 8, 2016 12:24:42 PM
Rank: Administration
Groups: Administration

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

Please try to increase HtmlToPdfOptions.MinLoadWaitTime and see if that helps. If that still does not work, please try to isolate the problem into a test page and send the test page to us. See here for more details:

http://www.essentialobjects.com/forum/test_project.aspx

Thanks!
Matt P.
Posted: Friday, September 9, 2016 11:42:55 AM
Rank: Newbie
Groups: Member

Joined: 9/7/2016
Posts: 2
MinLoadWaitTime did not help, but I found a great example of the issue. Using your live demo I created a PDF of this page: http://devilmaycode.altervista.org/how-do-you-create-a-marker-with-a-custom-icon-for-google-maps-api-v3/

You will see that the pin image is quite low quality. If you could tell me the appropriate settings to use to ensure a high-quality image, that would be much appreciated.

The image for the pin is: https://cdn1.iconfinder.com/data/icons/Webtoys/64/Pin.png

Thank you,
Matt
eo_support
Posted: Monday, September 12, 2016 8:28:04 AM
Rank: Administration
Groups: Administration

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

We do not see significant blurness for this particular pin image. Can you post your original pin image so that we can check again?

If your application uses Windows Forms, you can try to enable high DPI aware for your application and see if it helps:

Code: C#
//Import the API
[DllImport("user32.dll", SetLastError = true)]
static extern bool SetProcessDPIAware();

static void Main()
{
    //Enable high DPI awareness
    SetProcessDPIAware();

    //Run the main form
    Application.Run(new Form1());
}


Please let us know if this works for you.

Thanks!
Ron Heller
Posted: Tuesday, September 13, 2016 8:20:47 AM
Rank: Newbie
Groups: Member

Joined: 10/25/2011
Posts: 7
I have the same problem. I have a html (aspx) page on which I render some charts using chart.js. On screen in Chrome it looks very good and sharp. And when printing from Chrome to pdf is stays good!
But when converting the html to pdf using eo the charts are getting blurry and text is almost unreadable. It has something todo with scaling I suppose and I tried many html2pdf options. But nothing seems to work. I'am very interested in a solution for this scaling problem.
I render to page to A4 format, and the html renders the canvas to 900px.
eo_support
Posted: Tuesday, September 13, 2016 8:30:23 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Ron Heller wrote:
I have the same problem. I have a html (aspx) page on which I render some charts using chart.js. On screen in Chrome it looks very good and sharp. And when printing from Chrome to pdf is stays good!
But when converting the html to pdf using eo the charts are getting blurry and text is almost unreadable. It has something todo with scaling I suppose and I tried many html2pdf options. But nothing seems to work. I'am very interested in a solution for this scaling problem.
I render to page to A4 format, and the html renders the canvas to 900px.


Hi,

Have you tried to call SetProcessDPIAware?

Thanks!
Ron Heller
Posted: Tuesday, September 13, 2016 8:34:19 AM
Rank: Newbie
Groups: Member

Joined: 10/25/2011
Posts: 7
eo_support wrote:
Ron Heller wrote:
I have the same problem. I have a html (aspx) page on which I render some charts using chart.js. On screen in Chrome it looks very good and sharp. And when printing from Chrome to pdf is stays good!
But when converting the html to pdf using eo the charts are getting blurry and text is almost unreadable. It has something todo with scaling I suppose and I tried many html2pdf options. But nothing seems to work. I'am very interested in a solution for this scaling problem.
I render to page to A4 format, and the html renders the canvas to 900px.


Hi,

Have you tried to call SetProcessDPIAware?

Thanks!


No, I did not try that because it's a web application(aspx). SetProcessDPIAware is only available in windows forms applications (as far as I know).
eo_support
Posted: Tuesday, September 13, 2016 8:43:22 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Ron Heller wrote:

No, I did not try that because it's a web application(aspx). SetProcessDPIAware is only available in windows forms applications (as far as I know).


Please try it first. SetProcessDPIAware is a Windows API so you can use it in any application. The reason that its often mentioned with Windows Forms because for the two predominate desktop application platform, Windows Forms and WPF, it's only needed for Windows Forms because WPF already called that function for you.
Ron Heller
Posted: Tuesday, September 13, 2016 8:56:20 AM
Rank: Newbie
Groups: Member

Joined: 10/25/2011
Posts: 7
eo_support wrote:

Please try it first. SetProcessDPIAware is a Windows API so you can use it in any application. The reason that its often mentioned with Windows Forms because for the two predominate desktop application platform, Windows Forms and WPF, it's only needed for Windows Forms because WPF already called that function for you.


I've tried it, but there is no difference in the output pdf.
This is what I added in my code just before rendering the html to pdf (I tried SetProcessDPIAware and SetProcessDpiAwareness):

Code: C#
[DllImport("user32.dll", SetLastError = true)]
static extern bool SetProcessDPIAware();

[DllImport("SHCore.dll", SetLastError = true)]
private static extern bool SetProcessDpiAwareness(int awareness);
...

SetProcessDPIAware();
SetProcessDpiAwareness(1);
eo_support
Posted: Tuesday, September 13, 2016 9:18:30 AM
Rank: Administration
Groups: Administration

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

What's your system DPI setting?

Thanks!
Ron Heller
Posted: Tuesday, September 13, 2016 9:25:58 AM
Rank: Newbie
Groups: Member

Joined: 10/25/2011
Posts: 7
eo_support wrote:
Hi,

What's your system DPI setting?

Thanks!


I can't really find it in Windows 10, and I never changed it, but searching in my registry I found that my DPI (LogPixels) is 96
eo_support
Posted: Tuesday, September 13, 2016 5:29:47 PM
Rank: Administration
Groups: Administration

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

We have not been able to reproduce this problem in our environment. Can you create a test app or a test Url for us to reproduce the problem?

Thanks!
Ron Heller
Posted: Wednesday, September 14, 2016 3:50:27 AM
Rank: Newbie
Groups: Member

Joined: 10/25/2011
Posts: 7
eo_support wrote:
Hi,

We have not been able to reproduce this problem in our environment. Can you create a test app or a test Url for us to reproduce the problem?

Thanks!


Hello, I just send a email to support with a testproject. Thanks for the effort!
eo_support
Posted: Wednesday, September 14, 2016 8:57:54 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Thanks for the test project. We have received it and we will look into it and get back to you as soon as we find anything.
eo_support
Posted: Wednesday, September 14, 2016 1:06:02 PM
Rank: Administration
Groups: Administration

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

This is just to let you know that we have found the root cause of the problem. We will have a new build later this week to address this issue.

Thanks!
eo_support
Posted: Thursday, September 15, 2016 12:34:50 PM
Rank: Administration
Groups: Administration

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

We have posted a new build that should fix this problem. Please download it from our download page and let us know how it goes.

Thanks!
Ron Heller
Posted: Friday, September 16, 2016 2:19:55 AM
Rank: Newbie
Groups: Member

Joined: 10/25/2011
Posts: 7
eo_support wrote:
Hi,

We have posted a new build that should fix this problem. Please download it from our download page and let us know how it goes.

Thanks!


Thanks for the quick support, however when I download and install the new version I get an error from the installer:
EO.Total 2016 setup wizard ended permaturely because of an error. Your system has not been etc.....

No reason why the setup doesn't work. I tried both download links, but same error when installing.
Ron Heller
Posted: Friday, September 16, 2016 5:27:04 AM
Rank: Newbie
Groups: Member

Joined: 10/25/2011
Posts: 7
I managed to install the new version on another computer and copied to EO dll's to my project. Output looks great now! thanks for the update!
eo_support
Posted: Friday, September 16, 2016 7:31:52 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,083
Glad to hear it works for you! Please feel free to let us know if you run into any other issues.

As to the installer, please try to uninstall it on your computer, then reboot your computer and then try again to see if it works.

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.