PRTOPEN


8.0.3, PLBCMP GUI Only

 

The PRTOPEN instruction opens a print device that is written to as if it was a screen. The instruction uses the following format:

 

 

[label]

PRTOPEN

[{window};]{pfile},{device},{jobname}[,{options}...]

 

Where:

label

Optional. A Program Execution Label.

window

Optional. A previously created WINDOW object variable.

pfile

Required. A previously defined PFILE variable.

device

Required. A previously defined Character String Variable or Literal containing the name of a Windows print device.

jobname

Required. A previously defined Character String Variable or Literal containing the job name that identifies the job for the Windows print manager.

options

Optional. One or more of the keywords listed below.

Flags Affected: NONE

Note the following:

  1. If {pfile} is currently open, an implicit PRTCLOSE is performed prior to executing the PRTOPEN.

  2. If a hyphen (-) is specified for {device}, the settings for the last print open dialog or PAGESETUP instruction are used.

  3. If a device name of "@" or "@printer name" is specified, a Print Preview is performed upon execution of the PRTCLOSE instruction.

  4. If a device name of "@?" is specified, a Print Preview is performed after the print dialog upon execution of the PRTCLOSE instruction.

  5. The {jobname} may be up to one hundred (100) characters long and describes the job to the Windows print manager. If {jobname} is a Null String, the Windows print manager will list the job description as 'untitled'.

  6. If {device} is a Null String, the standard Windows print dialog is used. If the print dialog is canceled or some error occurs, a trappable S10 error is generated.

  7. {options} may be one or more of the following strings:

  8.  

    Option

    Specifies ...

    CANCELKEY={nvar | ivar}

    a numeric variable that is assigned a value of one if the print dialog was canceled. Note that an S10 error will still occur if the dialog is canceled. If the user program TRAPs the S10 error, the CANCELKEY variable value is set accordingly.

    FLAGS={value}

    a numeric variable or decimal constant that is a bit mask used to invoke specialized behaviors for the printed output. Bit mask values are described as follows:

     

    PRT_FLAGS_UNICODE EQU 4096 (0x1000)

     

    When this bit is turned on, the Unicode support is enabled and used for advanced printing output. In this case, the printer output device can be a Windows print device or the Sunbelt PDF output device (pdf:). Also the Unicode support applies to the print preview output. (10.7)

    PAGENUM={value}

    a value that controls the page number edit fields in a PRINT dialog. If the {value} is zero, the page number edit fields are disabled. If the {value} is not zero, the page number edit fields are enabled. When this option is not specified, the page number edit fields are enabled. Use the GETINFO instruction to retrieve print dialog user responses.

    PAGEWIDTH={value}

    a numeric variable that receives the page width calculated using the character width of the default font.

    PAGEHEIGHT={value}

    a numeric variable that receives the page height calculated using the character width of the default font.

    PIXELWIDTH={value}

    a numeric variable that receives the pixel width of the page.

    PIXELHEIGHT={value}

    a numeric variable that receives the pixel height of the page.

    MAXPAGE={value}

    a numeric variable or decimal constant indicating the initial value for the maximum number of pages entry in the print dialog.

    NOPRINT

    that data should be spooled only. The PRINT button is disabled.

    RETSPLNAME={value}

    a string to receive the qualified spool file name after the instruction is completed. If the spool file option is not specified, the RETSPLNAME option will null the string.

    SELECTION={value}

    a numeric variable or decimal constant that controls the print dialog selection field. If the {value} is zero, the selection control is disabled. If the {value} is not zero, the selection control is enabled. When this option is not specified, the selection field is disabled. Use the GETINFO instruction to retrieve print dialog user responses.

    SPOOLFILE={value}

    a character variable or literal indicating the spool file name. The default spool extension is acquired from screen definition file. If {value} is a Null String, a standard Windows file prepare dialog is invoked. This keyword is not supported when using the PL/B Web Server runtime.

 

  1. If a FILEPI is active and {device} is a Null String causing activation of the print dialog, the FILEPI is terminated.

  2. A PRTCLOSE is automatically executed for each open print file when a CHAIN instruction is executed unless the {pfile} is in the Global Data Area.

  3. Multiple job streams from the same program or other programs may be concurrently active for any of the print devices.

  4. The actual output is queued until a PRTCLOSE is executed or control returns to the operating system.

  5. If the optional {window} is not specified, the currently active window is used.

  6. Printer information is available while {pfile} is open by using the GETINFO instruction.

  7. The printer name may be retrieved following a PRTOPEN with the GETFILE instruction.

  8. An {ip address} may be appended to the spool file keyword file name. This generates the advanced print spool file at the SUNDM data manager identified by the {ip address}. When using a $MACRO file name or Datapoint name format for the SPOOLFILE keyword, the PLBENV and PLBVOL keywords are only found/resolved by the PL/B runtime executing a program. In this case, the SUNDM does not resolve any PLBENV or PLBVOL keywords.

  9. Additional information regarding this instruction is available from PRTOPEN PDF Notes.

  10. When using the PL/B Web Server, the {device} string cannot have a leading '!' character since a {device} printing device cannot be opened at the client browser. If a leading '!' is used for the {device} string, a U67 error occurs.

 

 

See Also: Example Code, SPLOPEN, Printer Instructions

 



PL/B Language Reference PRTCLOSE PRTPAGE