*UNITS (PRTPAGE)


PLBCMP GUI Only

*UNITS={*type}

 

This list control specifies the units used when positioning and sizing objects on an advanced print page. The allowable {type} units are defined as follows:

 

Type

Positions by

*CHARS

characters based on Courier New font size 11 (default)

*LOENGLISH

.01 of an inch

*LOMETRIC

.1 of a millimeter

*HIENGLISH

.001 of an inch

*HIMETRIC

.01 of a millimeter

*PIXELS

pixel

*TWIPS

.05 of a point [1/1440 of an inch]

*FONT

current font size

Note the following:

  1. When a PRTOPEN instruction is first executed, the *UNITS {type} is set to '*CHARS' as the default.

  2. When the '*UNITS=*FONT' control is used in a PRTPAGE, the font metrics including the average character height and width are used in generating the printed output. In this case, the current font metrics are retrieved from the Windows as determined after the font has been created for a specific font size and selected into a device context for a printer. The current font metrics may give different results depending on the print driver and the resolution used for a given printer.

  3. When the Sunbelt 'pdf:' device is being used to generate PDF output, the 'pdf:' is directly generating the PDF output without requiring a Windows printer. By default, the font metrics are retrieved directly from the font files being used. Since the font metrics are not being generated via a device context for a printer device, the print positions can be different from direct printed results using an OS print driver. Therefore, a PLB application using the PRTPAGE '*UNITS=*FONT' control can give unexpected results for the Sunbelt PDF print positions as compared to the direct printed output.

  4. Changes have been made in the 9.6D patch release to allow the PLB developer to change the behavior of the runtime such that the current default printer renders Windows fonts when PRTPAGE operations with '*UNITS=*FONT' is being used. The following features have been made to the 9.6Df runtime to control the PDF font rendering issue for '*UNITS=*FONT':

    1. A new keyword named 'PLBWIN_PDFDEFPRTMETRICS={ON|OFF}' has been added to set the default state that enables or disables the default printer used for rendering fonts for PDF generation. By default, the runtime behavior is the same as setting this keyword to an OFF state. When this keyword is used and set to an ON state, the runtime uses that current default printer for the Windows at the system where the runtime is executing to render fonts for '*UNITS=*FONT' operations. The default behavior is to process font metrics directly from the font files without font rendering.

    2. A keyword named '*PDFDEFPRTMETRICS={nvar}' has been added for the GETMODE\SETMODE instructions. If this keyword is set to a non-zero value, the runtime turns on font rendering using the current default printer for '*UNITS=*FONT' operations when generating Sunbelt PDF output. The GETMODE retrieves the current state value for the *PDFDEFPRTMETRICS keyword.

    3. A keyword named '*PDFDEFPRTNAME={svar}' has been added for the GETMODE\SETMODE instructions. This keyword assigns a specific Windows printer device that is to be used in place of default printer when rendering fonts for the '*UNITS=*FONT' operations during Sunbelt PDF output.

Example:

PF PFILE

UsrPrt INIT "Microsoft XPS Document Writer"

.

PRTOPEN PF,"pdf:", "MyJob", PDFNAME="My.pdf"

       .....

*

.Set user printer used for font rendering to generate font metrics.

.

       SETMODE *PDFDEFPRTNAME=UsrPrt,*PDFDEFPRTMETRICS=1 //Turn on font rendering

.

        PRTPAGE PF; *FONT=">Arial", *UNITS=*FONT;

.

        PRTPAGE PF;*P10:15,"Print Data at column 10 row 15..."

        ...

 

 

See Also: List Controls (PRTPAGE), PRTPAGE

 



PL/B Language Reference *ULON (PRTPAGE) *V (PRTPAGE)