Electronic Ink
TECH NOTES   TECH NOTE #10    
Home
Products
Tech Notes
Purchase
Tech Talk
Contact Us

Tech Note: Customizing (and Hiding) the Print Dialogs

Products: PrintOMatic MX Xtra, PrintOMatic Xtra 1.6.5
Platforms: all

There are three dialogs associated with the printing process in PrintOMatic. These dialogs are:
  • The Page Setup Dialog
  • The Job Setup Dialog
  • The Print Progress Dialog
The first two dialogs can be displayed to the user or not, at your discretion. The Print Progress dialog can be hidden from the user, positioned wherever you want it on the screen, or customized with a graphic of your choice.

Pre-Requisites

Before you can customize the printing dialogs, you must be using document objects instead of the simple "print" commands to do your printing.

You create a document object by "creating an instance" of the PrintOMatic Xtra, and then manipulating the document object before you finally print its contents. A basic printing framework that uses a document object to print (with the normal dialogs) looks like this:

    set doc = new (xtra "printomatic")
if not objectp(doc) then exit
append doc, member "blah"
if doJobSetup(doc) = TRUE then print doc
set doc = 0

Displaying the Page Setup Dialog

You must display the page setup dialog box before you add anything to your document. Once you start addding items to your document object, the page layout cannot be changed. Display the page setup dialog by adding a new line to the basic script:

    set doc = new (xtra "printomatic")
if not objectp(doc) then exit
if doPageSetup(doc) = FALSE then exit
append doc, member "blah"
if doJobSetup(doc) = TRUE then print doc
set doc = 0

The "if" statement bracketing the doPageSetup command cancels the print job if the user clicks the "Cancel" button.

Hiding the Job Setup Dialog

It’s easy to hide the job setup dialog box from your users. Simply don’t call doJobSetup() before calling print:

    set doc = new (xtra "printomatic")
if not objectp(doc) then exit
append doc, member "blah"
print doc
set doc = 0

Hiding the Print Progress Dialog

To hide the print progress dialog, use the setProgressLoc() command to position it off the screen using negative coordinates:

    set doc = new (xtra "printomatic")
if not objectp(doc) then exit
append doc, member "blah"
setProgressLoc doc, Point(-1000,-1000)
if doJobSetup(doc) = TRUE then print doc
set doc = 0

The setProgressLoc command is only available when you register your copy of the Xtra.

Customizing the Print Progress Dialog

You cam place your own custom bitmap into the Print Progress Dialog. Simply use the setProgressPict() command to specify a bitmap cast member you would like to use:

    set doc = new (xtra "printomatic")
if not objectp(doc) then exit
append doc, member "blah"
setProgressPict doc, member "myprogresspict"
if doJobSetup(doc) = TRUE then print doc
set doc = 0

The setProgessPict command is only available when you register your copy of the Xtra.

Print this Tech Note Print this Technical Note

©1994-2018 Electronic Ink. All rights reserved.