Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Problem Rendering PDF w/ Windows Scale is not 100%
  FAQ FAQ  Forum Search   Register Register  Login Login

Problem Rendering PDF w/ Windows Scale is not 100%

 Post Reply Post Reply
Author
Message
waynefulcher View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Jun 08
Location: United States
Status: Offline
Points: 99
Post Options Post Options   Thanks (0) Thanks(0)   Quote waynefulcher Quote  Post ReplyReply Direct Link To This Post Topic: Problem Rendering PDF w/ Windows Scale is not 100%
    Posted: 02 Mar 21 at 10:54PM
I am using Delphi 7 and the QuickPDF Library (version 16.13).
In my code I am calling the RenderPageToFile() method.
I have tested this with many different parameters but the combination that I can not get to work correctly just happens to be the only option I actually need.

So if I render the page passing in the Option/Format as 8 (EMF+) it works perfectly fine, UNLESS you right-click your windows desktop and select Display Settings and then change your scale to something other than 100%. I tested with 150%. Then when rendering as EMF+ the content on the page is not correctly scaled. So for example if the PDF has a paragraph of text that basically goes from side to side of a letter size page then if Windows Scale is 150% and page is rendered as EMF+ then the text shrinks to only about half the width of the page.

If I test other formats, such as 1 (JPEG) then it seems to still scale the content on the page correctly even when Windows scale is at 150%.

Anyone have any idea how I might be able to fix this?

Thanks
Back to Top
tfrost View Drop Down
Senior Member
Senior Member


Joined: 06 Sep 10
Location: UK
Status: Offline
Points: 437
Post Options Post Options   Thanks (0) Thanks(0)   Quote tfrost Quote  Post ReplyReply Direct Link To This Post Posted: 03 Mar 21 at 10:58AM
Rendering to EMF is a problem because EMF seems to always need a reference DPI from a printer or screen, as you have found. However you should be able to simply check the screen DPI before rendering, and adjust the DPI when you render. Things get more complicated when you have screens of different resolutions in use, especially if the window has been moved from one to another, or if you are writing a service application without a window. The DPI of the primary monitor may be the one you want, but experimentation and testing are essential.

Using one of the other renderers supported by QPDF may also help (see SelectRenderer in the documentation).  However this involves distributing an extra DLL with your application. And note that DPLPDFIUM may not be thread-safe.
Back to Top
waynefulcher View Drop Down
Senior Member
Senior Member
Avatar

Joined: 23 Jun 08
Location: United States
Status: Offline
Points: 99
Post Options Post Options   Thanks (0) Thanks(0)   Quote waynefulcher Quote  Post ReplyReply Direct Link To This Post Posted: 03 Mar 21 at 4:28PM
Thanks for your feed back I will look into the SelectRenderer to see if that can provide any help.
But as to the comment about DPI, that is not exactly how that works. The DPI and Scale is slightly two different things. For example in the call to RenderPageToFile() it has a DPI parameter which I pass in, I have tested with many different values and the only difference it makes is how clear the results are and the size of the output. So 60 is blurry but the size is very small (not visually), 150 dpi is a good balance between clarity but not too big in size then as you try 300 or 600 the clarity gets slightly improved but the size of the output is very large.

The problem is the scale of the rendering to the size of the page. So something in rendering must be using one DPI for the width/height of the page and something different for the content.


The issue here actually seems to be a Windows issue and whatever GDI+ driver that is installed with windows. In searching I have read about many other applications having the same sort of problem with Scale (not DPI). Oddly enough Microsoft used to supply a checkbox to correct the issue in their display settings back in Windows 7 but that checkbox does not exists in Windows 10. So I guess I will try to see if windows has a fix for Windows 10 or if I can somehow use a different renderer but that seems like any other renderer will also rely on the GDI+ libraries installed on the computer which most likely means they probably all will have the same issue.

If I find a solution I will come back and post it for other to use.
Thanks again.



Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store