Tech Note: Selecting Paper Sizes on Macintosh

Products: PrintOMatic Lite Xtra 1.6.5, PrintOMatic Xtra 1.6.5
Platforms: Mac OS 8, Mac OS 9

The PrintOMatic and PrintOMatic Lite Xtras use the current printer driver to determine the default paper size for your documents. You can control this setting in a number of ways:

Selecting a Printer Driver

On Macintosh systems, you select your printer driver using the Chooser application (accessible from the Apple menu.) When you open the Chooser, you are presented with icons representing the different printer drivers that you have installed. After you select the desired driver, the Chooser will display all available printers on the right side of the dialog. Next, you click on the name of the printer that you want to use.

On Macintosh systems, selecting a printer and printer driver does NOT give you the option of selecting the default paper size. This setting is controlled explicitly from the standard Page Setup dialog.

Therefore, to allow PrintOMatic Xtra documents to be printed using paper sizes other than the default, you need to use the doPageSetup command. Using doPageSetup If you plan to make use of this PrintOMatic Xtra command, you should call it prior to adding any content to your document. This command will give the user the opportunity to select the paper size they want to use by displaying an OS standard Page Setup dialog.

Once the user has made their selection, you can determine the dimensions of the paper size that they have selected by using the getPaperWidth() and getPaperHeight() functions. In addition, you can adjust the document layout space to the maximum allowed by the current paper size setting by using the setPrintableMargins command.

Using SavePageSetup and LoadPageSetup

If you want to make a specific paper size the default, you can accomplish this on the Macintosh by using the savePageSetup and loadPageSetup commands. The savePageSetup command uses the following syntax: savePageSetup object, string fileName, string fileType, string fileCreator, int resourceID object: this should be the instance of the PrintOMatic Xtra you have created fileName: this should be an explicit path and filename for storing the page setup information fileType: this should be a four character sequence. You can use something of your own design, such as "PAGE" fileCreator: this should be a four character sequence. You can use something of your own design, such as "POMX" resourceID: this should be an integer value from 1 to 255. You can save multiple page setups into the same file, so you can use this id to identify the separate page setups.

Example:

    savePageSetup myDocument, the pathName & "pageSetups", 
"PAGE", "POMX", 1

You can treat this command as a function to verify that your attempt to save the page setup information was successful:

    put savePageSetup(myDocument, the pathName & "pageSetups", 
"PAGE", "POMX", 1) into saveSuccess
if saveSuccess then
-- continue on
end if

It’s important to note that this command saves the information currently stored in the Page Setup dialog. So, if you want to save non-default settings, you need to first call the doPageSetup command to allow the user to select new settings.

Alternatively, you can do this yourself prior to delivering your project. You can save multiple page setups into the same file (or use separate page setup files) so you can store the settings for several paper sizes in advance.

Once you have created page setup files, you can use them with the loadPageSetup command. The loadPageSetup command uses the following syntax:

    loadPageSetup object, string fileName, int resourceID

object: this should be the instance of the PrintOMatic Xtra you have created

fileName: this should be an explicit path and filename for storing the page setup information

resourceID: this should be an integer value from 1 to 255. You can save multiple page setups into the same file, so you can use this id to identify the separate page setups.