| Search Locate Previous | Contents |
The PostScrp namespace contains the functions necessary to convert your NewLeaf report into a wide variety of graphics formats. You can view the report on screen, print it to your Windows printer, direct it to any PostScript device, and so on. All the examples shown below assume you have saved the intermediate format of your report in a character variable PG. The available functions are:
View the Report
To see the report on screen, zoom in on any selected region, read off data values from the mouse cursor etc. ...
PostScrp.View PG
The right-mouse menu in the viewer supports many of the facilities listed below. All the text captions in the viewer may be loaded from a phrasebook file with PostScrp.GetPhraseBook phbfile. The workspace is shipped with a UK-English phrasebook (uk-en.phb) and phrasebooks for other languages will be shipped as they become available. You might choose to load your local phrasebook once and ship your product with a permanent phrase table, or you might have the application load it on startup depending on your users choice of language for the application.
Print the Report
To have the report printed on your standard Windows printer ...
PostScrp.Print PG
This will orient the paper automatically to match the orientation of the chart. You can preset the target printer with:
PostScrp.OpenPrinter 'Tektronix 840,\\SERVER\Tek840'
which will route all prints to this destination until you call PostScrp.ClosePrinter.
A null argument to OpenPrinter will open the Windows default printer.
Output to PostScript Devices
NewLeaf reports can be written directly to any PostScript printer, or saved on file in PostScript format.
'\\server\tek840' PostScrp.Write PG © Direct to printer 'C:\temp\RAIN.PS' PostScrp.Write PG © Write to PS file
If you omit the file name, the default is prn which will output to your default printer. If you have a colour printer (such as the Tektronix-840) set PostScrp.rgb1 which allows full-colour output. Otherwise the results will be better if the chart is forced to use a black&white colour map with PostScrp.rgb0.
file PostScrp.WritePDF PG © for Distiller
The files saved in this format are ideal for use with Acrobat Distiller to generate PDF documents; there is a sample function ToPDF in the NewLeaf workspace which you can change to route the PostScript data directly to Distillers inbound directory. To add your own outline tree to a PDF document, please refer to inserting a bookmarks with leaf.Bookmark.
Extracting header comments
You can use PostScrp.ReadHeader to read any of the header comments (such as the page bounding box) which you may find useful in your own event handlers or rendering code.
Checking the bookmark table
If you want to construct your own viewer, with a tree-structured table of contents, you can check the page-count, title and bookmarks table with infoPostScrp.Info spl. The bookmarks table is a 3-column matrix giving the bookmark name, page number and indent level.