skip to main content

Library Routines : P$

P$
The P$ library routines allow access to printing features.
resets the Choose Printer dialog
disables automatic Choose Printer dialog
shows the Choose Printer dialog
enables automatic Choose Printer dialog
retrieves current Choose Printer dialog fields values
sets values for the Choose Printer dialog
Note - These routines are supported for RM/COBOL compatibility. In order to take advantage of every print feature provided by isCOBOL, refer to WIN$PRINTER.
Examples:
Example - Create a graphical document
       program-id. pprinter.
       input-output section.
       file-control.
       select print-job assign to printer spooler-name
           organization line sequential.
       file section.
       fd  print-job.
       01  print-record            pic x(80).
       working-storage section.
       copy "isgui.def".
       copy "iscrt.def".
       copy "isopensave.def"
       77  crt-status              is special-names crt status pic 9(5).
       77  hWin                    handle of window.
       77  close-win               pic 9 value 0.
       77  spooler-name            pic x(128).
       screen section.
       01  mask. 
           03 push-button
              line                 2
              col                  2
              title                "&Print"
              exception-value      101
           03 push-button
              line                  2
              col                   + 2
              title                 "Pre&view"
              exception-value       102
           03 push-button
              line                 2
              col                  + 2
              title                "PD&F"
              exception-value      103
       procedure division.
           call "c$guicfg" using "Printer Dialog Always=False"
           call "c$setdevelopmentmode"
           display independent graphical window  
           display Mask   
           perform until crt-status = 27 or close-win = 1
             evaluate crt-status
           destroy hwin    
           move "-p preview" to spooler-name
           perform print-procedure
           initialize opensave-data, spooler-name.
           accept opnsav-default-dir from environment "user-path"
           move "PDF Files (*.pdf)|*.pdf" to opnsav-filters
           move "pdf"                     to opnsav-default-ext
           call "c$opensavebox" using opensave-save-box
           if return-code < 0
           string "-P PDF "       delimited by size
           perform print-procedure
           move "-p spooler" to spooler-name
           perform print-procedure
           open output print-job
      *print of bitmap pictures
           call "p$drawbitmap" using "files/img.png"
      *print of colored strings (a red text in this case)
           call "p$settextcolor" using "Red"
           call "p$textout" using "colored string"29,
      *print of graphical shapes (how to create a table)
           call "p$drawbox"  using 210"Absolute""Metric"
           call "p$drawline" using 510"Absolute""Metric"
           call "p$drawline" using 212"Absolute""Metric"
           close print-job
           if event-type = cmd-close
              move 1 to close-win

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left