PDF PRTPLAY Notes


9.6A

The syntax of a PRTPLAY instruction is as follows:

 

[label] PRTPLAY {spool file},{prtname}[,{options }...]

Note the following:

  1. If the {prtname} for the PRTPLAY is specified with the 'pdf:' printer device name, the 'JOBNAME={name}' option can be null or it can contain the fully qualified path and PDF file name where the Advanced Print operations are to be written for the un-spooled actions of the PRTPLAY instruction. If the JOBNAME is not specified or if it is specified as a null variable or literal, a file selection dialog is presented to allow the end-user to specify the output PDF file name. Optionally, an {options} keyword named 'PDFNAME={svarslit}' specifies a PDF output file name. If the PDFNAME keyword parameter is used, the PDFNAME file name is used for the PDF output and the JOBNAME is expected to contain a print job name.

  2. The basic PDF output is written requiring a PDF reader version 1.4 or later.

  3. The PDF support as implemented by the PRTPLAY instruction can allow existing PLB advanced print spool files to be converted to a PDF file as needed by a PLB application.

  4. The internal processing for the PRTPLAY instruction requires the Windows sub-system. Therefore, a PRTPLAY statement executed by a PLBSERVE Application Server is always processed at the PLBCLIENT client workstation. In addition, the PDF output for a PRTPLAY is always generated and located at the PLBCLIENT client workstation.

  5. A new {options} keyword named 'FLAGS={dnumnvar}' has been added for a PRTPLAY instruction that specifies a numeric value that is a bit mask to invoke specialized behaviors for the PDF implementation:

  6. FLAGS={dnumnvar}
    Bit mask value to invoke specialized behaviors for the PDF support implemented for advanced printing. The bit mask values are defined as follows:
     
    PDF_FLAGS_NO_COMPRESSION EQU 1
    Do not compress data in the PDF output file.
     
    PDF_FLAGS_EMBED_FONTS EQU 2
    Embed fonts in the PDF output file. When built-in fonts named Times, Helvetica, and Courier are being used in a PRTPAGE *FONT control, these fonts are not embedded the PDF output file. Only, non-built-in fonts are embedded in the PDF output file. The default behavior for the PDF output is to automatically embed fonts.
     
    PDF_FLAGS_SUB_GENFONTS EQU 4
    When this bit is turned on, the PDF support detects that a Windows font with a specific name is used in a PRTPAGE and a PDF built-in generic font is substituted and put into the PDF output file. If the 'PDF_FLAGS_SUB_WINFONTS' flag bit value is not used, the default behavior of the runtimes is the same as when the 'PDF_FLAGS_SUB_GENFONTS' bit value is turned on. See the following table:

     

    Windows Font in SpoolFile
    PDF Output Font
    Times New Roman
    Times
    Arial
    Helvetica
    Courier New
    Courier

     

    PDF_FLAGS_SUB_WINFONTS EQU 8

    When this bit is turned on, the PDF support detects when a PDF built-in font with a specific name is used in a PRTPAGE and a Windows font is substituted and put into the PDF output file. If this 'PDF_FLAGS_SUB_WINFONTS' flag bit value is not used, the default behavior of the runtimes is the same as when the 'PDF_FLAGS_SUB_GENFONTS' bit value is turned on. See the following table:

     

    PDF Built-in Font in SpoolFile
    PDF Output Font
    Times
    Times New Roman
    Helvetica
    Arial
    Courier
    Courier New

     

    PDF_FLAGS_NOSUB_FONTS EQU 12
    When both the 'PDF_FLAGS_SUB_GENFONTS' and 'P_FLAGS_SUB_WINFONTS' bit values are specified at the same time, the PDF support allows both Windows fonts and generic fonts to be output into a PDF file. When using this FLAGS setting, any generic fonts specified in a PL/B program are changed to be a Windows font when the PDF file is generated via a PRINT PREVIEW or a PRTPLAY using a spool file. Also, using this FLAGS setting, there is no font substitution when generating a PDF file directly if PRINT PREVIEW and PRTPLAY are not being used.
     
    PDF_FLAGS_ZERO_DEF_MARGINS EQU 16
    When this bit is turned on, the top and left margins are set to zero when generating the PDF output. This bit mask value can be used when the PLB application is attempting to create a Sunbelt PDF output consistent with a 3rd party PDF writer that does not use the top and left margins.
     
    PDF_FLAGS_NO_EMBED_FONTS EQU 32
    When this bit is turned on, fonts are not embedded in the PDF output. This bit mask value overrides the default action where fonts are embedded into the PDF output.
     
    PDF_FLAGS_ALWAYS_PDF_OUTPUT EQU 64
    When this bit is turned on, exiting the PRINT Preview window always generates a PDF output when the PRINT Preview has the PDF output as an optional output and the PRINT Preview CLOSE button is selected. This bit only takes affect if the PRINT Preview window CLOSE button is selected. Therefore, if a PRINT Preview has both the 'ToPrint' and 'ToPDF' buttons specified, this bit has no affect if the 'ToPrint' button is selected.
     
    PDF_FLAGS_WIN_ANSI_ENCODING EQU 128

    When this bit is turned on, the PDF output is set to enable Windows ANSI encoding when national characters with character values greater than 0x7F are used. This Windows ANSI encoding causes PDF readers to properly interpret and present the national characters.

     

  7. The {options} keyword PDFNAME={svarslit} specifies a fully qualified path and file name used to write the PDF output.

  8. PDFNAME={svarslit}

    This optional keyword parameter specifies a path and file name to write the PDF output. When the keyword parameter is used, it takes precedence and its file name is used for PDF output instead of the JOBNAME string. The implementation of this keyword is intended to give a PL/B application the flexibility to specify both a JOBNAME and a PDF output file name when using an advanced Print Preview that has both a PRINT and PDF output button available.

  9. The PRTPLAY instruction for PDF output supports the PL/B file name formats including the keyword substitution for Datapoint and '$' macro formats. This enhanced file name support applies to the 'PDFNAME' option and the {jobname} parameter when the {device} is directed to the 'pdf:' output device.

  10. When executing a PRTPLAY instruction using the PL/B Application server (i.e., Plbserve), output local to the server system is not supported. Therefore, the PRTPLAY instruction always renders the {device} output to the PLBCLIENT client workstation.

  11. The PRTPLAY instruction is not supported by the PL/B Web Server runtime. In this case, an U67 error occurs.

Examples of a PRTPLAY to a PDF file:

 

     PRTPLAY "test.spl","pdf:",JOBNAME="c:\temp\testspl.pdf"

The PDF file output is generated at the PLBCLIENT client workstation.

 

    PRTPLAY "test.spl","pdf:",PDFNAME="c:\temp\testspl.pdf"

The PDF file output is generated at the PLBCLIENT client workstation.

 

    PRTPLAY "test.spl","@pdf:",JOBNAME="c:\temp\testspl.pdf"

A Print Preview is presented to the end user at the PLBCLIENT client workstation. The Print Preview has a single output button titled 'To PDF'. The PDF output file is located at PLBCLIENT client workstation.

 

    PRTPLAY "test.spl","@pdf:",PDFNAME="c:\temp\testspl.pdf"

A Print Preview is presented to the end user at the PLBCLIENT client workstation. The Print Preview has a single output button titled 'To PDF'. The PDF output file is located at PLBCLIENT client workstation.

 

    PRTPLAY "test.spl","@HP-Printer",JOBNAME="My Job Name",PDFNAME="c:\temp\testspl.pdf"

A Print Preview is presented to the end user at the PLBCLIENT client workstation. The Print Preview has two output buttons. One button is titled 'To PDF' and the other button is titled 'PRINT'. If the 'PRINT' button is selected, the printed output is at the PLBCLIENT client workstation. If the PDF output is selected, PDF file is located at PLBCLIENT client workstation.

 

 

See Also: PDF Support, Printer Instructions



PL/B Language Reference PDF PRTOPEN Notes PDF GETFILE Notes