Page 1 of 1

TPrintPreview and windows 8

PostPosted: February 26th, 2013, 3:45 pm
by PeterD
Hi,

I've been using TPrintpreview for a while and it works perfect, thank you for the product!

I recently came across an issue when using TPrintPreview on a windows8 laptop. When the user has increased the font-size then TPrintPreview does not apply the Screen.PixelsPerInch corredctly.
On a win7 machine, the Screen.PixelsPerInch returns 120 when the font-size is increased to 125%. On windows8 it always returns 96, which makes TPrintPreview fail in showing the canvas correctly.

I found others reporting this issue about windows8 as well. On of the solutions I found was to read the registry HKEY_CURRENT_USER\CONTROL PANEL\Desktop\WindowMetrics which holds the correct value.

I ended up adjusting preview.pas so it reads the value from registry as well. When registry and Screen.PixelsPerInch are not the same, then I take the assumption the value from the registry is the correct one.

So far it seems to be working for me, so I thought to share this information.

Thanks for the great product again!

Peter

Re: TPrintPreview and windows 8

PostPosted: February 26th, 2013, 5:55 pm
by Kambiz
You're very welcome!

Thanks for sharing this information.

Re: TPrintPreview and windows 8

PostPosted: January 6th, 2015, 11:26 am
by jcmartini
Hello Peter, Kambiz,

I am using TPrintPreview for years with C++Builder and it works fine now with XE7 under W7. Thanks a lot for your valuable work Kambiz.

I am now facing with the same problem, I believe, (without font scaling) in using my application on a laptop running W8.1: TPrintPreview do not fill the paper's with and length. I am not very used with Delphi and I am interested to apply the modification you did (reading to the the registry HKEY_CURRENT_USER\CONTROL PANEL\Desktop\WindowMetrics). I get the same result with the demo programs. So, could you give us the update you wrote to preview.pas ?

Thanks in advance.

Jean-Claude

Re: TPrintPreview and windows 8

PostPosted: January 12th, 2015, 9:39 am
by jcmartini
Hello,
I am surprise that nobody has the same problem. I join a screen capture for showing my problem. Maybe I didn't found it in the forum (?).
Regards.
Jean-Claude

Re: TPrintPreview and windows 8

PostPosted: March 23rd, 2015, 9:36 am
by jcmartini
My problem was finally solved by including a manifest file in the demo (application->options).
See: http://stackoverflow.com/questions/2685 ... upport-per

Regards
Jean-Claude