PxPlus User Forum

Twitter Twitter Twitter

Author Topic: 'PEN' width when printing to *PDF* versus *WINPRT*  (Read 304 times)

Loren Doornek

  • Silver Member
  • ***
  • Posts: 25
    • View Profile
'PEN' width when printing to *PDF* versus *WINPRT*
« on: February 20, 2020, 10:27:14 AM »
I'm trying to print a rectangle to either a printer using *winprt*, or a PDF file using *pdf*.  I'm using the 'pen' mnemonic to set the width of the lines for the rectangle. But, the width of the lines is significantly different between the *winprt* output and the *pdf* output. 

I'm using Nomads to design a form, and adding a Shape control to the screen, which is a rectangle.  The pen width is taken from the Width field of the Nomads shape.  That field is defined in the documentation as using graphical units, and can have a value of 0-255.

This appears to be related to the resolution of the output.  If I print the rectangle to a *winprt* printer with a resolution of 300x300, the rectangle prints as expected.  But, if I use the same logic to print to *pdf*, the lines of the rectangle seem to be about 4 times thicker.  I can't find a method to set the resolution for *pdf*, but it appears that the resolution of the *pdf* may be 72x72.  Thus, a graphical unit on *pdf* would be 4.17 times larger the graphical unit on the printer, since 300/72=4.17.  I'm not certain that this is how graphical units work, or if this is the problem.

In a nutshell, I want to be able to print a rectangle to either *winprt* (various printers) or *pdf*, and have them look nearly identical.  Any suggestions on how to properly handle the 'pen' width would be appreciated!