home *** CD-ROM | disk | FTP | other *** search
/ Sunday Savers: Sharing Fun! I Know My Savior Lives / Sunday Savers: Sharing Fun! I Know My Savior Lives.iso / mac / Xtras / PrintOMatic MX 1.7.3 / PrintOMatic MX (Win32) / -PrintOMatic MX Demo.dir / 00032.txt < prev    next >
Encoding:
Text File  |  2004-04-06  |  7.2 KB  |  114 lines

  1. Getting and Setting Document Attributes
  2.  
  3. The following commands are used get and set the attributes of a PrintOMatic document:
  4.  
  5.     setDocumentName        Sets the name of the document
  6.     setLandscapeMode    Sets landscape or portrait orientation
  7.     getLandscapeMode    Returns the landscape mode of the document
  8.     setMargins            Sets the margins of the document
  9.     getMargins            Returns the margin settings of the document
  10.     setPrintableMargins    Sets the document margins to the maximum area the printer can print
  11.     getPageWidth        Returns the width between left and right margins
  12.     getPageHeight        Returns the height between the top and bottom margins
  13.     getPaperWidth        Returns the width of the physical paper
  14.     getPaperHeight        Returns the height of the physical paper
  15.  
  16. Routines that alter the size or orientation of a document, such as setLandscapeMode, setMargins, and setPrintableMargins, can only be called when your document is empty.setDocumentName
  17.  
  18. Syntax:    setDocumentName document, name
  19.  
  20. This command sets the name of a PrintOMatic document, which is displayed in the print progress dialog as the document prints. If background printing is enabled, this document name is also displayed by PrintMonitor (Mac) or Print Manager (Windows) as your document prints in the background.setLandscapeMode
  21.  
  22. Syntax:    setLandscapeMode document, trueOrFalse
  23.  
  24. This command switches the page orientation of a document object between landscape and portrait orientation. Since this method changes the whole coordinate system of the document, your document must be empty when you call setLandscapeMode. You can call reset on your document beforehand just to make sure.
  25.  
  26. Windows and Mac OS X
  27.  
  28. In Windows and Mac OS X, this method works in a very straightforward manner: call it, and the landscape mode changes.
  29.  
  30. Mac OS 9 / Classic Mac OS
  31.  
  32. Unfortunately, it's an entirely different story on Mac OS 9 / Classic Mac OS. The only safe way to change the page orientation on the Mac is by showing the Page Setup dialog and letting the user manually select landscape mode. While showing a Page Setup dialog may be fine for normal software applications such as Word, it's often unacceptable in the context of a multimedia production.
  33.  
  34. To get around this, PrintOMatic for Mac OS 9 relies on a "printer database" to store default landscape and portrait page setups for the most common Macintosh printers. This printer database consists of a set of 'PHDL' resources located in the same file as the PrintOMatic Xtra. This database is used by the setLandscapeMode method in the Macintosh version of PrintOMatic.
  35.  
  36. If the currently selected printer is not found in the printer database, the user is asked to MANUALLY create default Page Setups for landscape and portrait modes, and those settings are saved and added to the database. This is done through a series of prompt dialogs presented automatically by PrintOMatic when you call setLandscapeMode for an unknown printer.
  37.  
  38. These user-configured "custom entries" to the printer database are stored in a file called "PrintOMatic Preferences" in the Preferences folder on the user's hard disk. Subsequent calls to setLandscapeMode on the same computer, with the same printer selected, won't present any annoying dialogs.
  39.  
  40. What the presence of this "printer database" means is that when you change the landscape mode on the Macintosh, all the other Page Setup settings such as scaling, font substitution, etc., will also revert to those found in the printer database. This is important if the user has changed any of these settings (during a call to doPageSetup) before setLandscapeMode is called.getLandscapeMode
  41.  
  42. Syntax:    getLandscapeMode(document)
  43.  
  44. Returns: TRUE if the document has a landscape orientation, otherwise FALSE
  45.  
  46. This command retrieves the page orientation of a document object. getLandscapeMode returns TRUE if the document has a landscape (horizontal) orientation.setMargins
  47.  
  48. Syntax:    setMargins document, marginRect
  49.  
  50. This command sets the margins of a document object. The marginRect parameter is in the form of a Lingo Rect. Values are specified in the format Rect(left, top, right, bottom). The measurements are in points (72 points to the inch). Since this method changes the whole coordinate system of the document, your document must be empty when you call setMargins. Call reset on your document beforehand just to make sure.
  51.  
  52. Example:
  53.  
  54. The following example creates a new document and sets the margins to two inches (144 points) on the left, and one inch (72 points) on all other sides.
  55.  
  56.     set doc = new(xtra "PrintOMatic")
  57.     if not objectP(doc) then exit
  58.     setMargins doc, Rect(144,72,72,72)getMargins
  59.  
  60. Syntax:    getMargins(document)
  61.  
  62. Returns: the document margins, in Lingo Rect format
  63.  
  64. This command retrieves the margins of a document object. The return value is a Lingo Rect, but the Rect itself is not a valid rectangle; rather, the top, left, bottom, and right values of the Rect are used to return the margin width on each of those sides. The margin measurements are in points (72 points to the inch).setPrintableMargins
  65.  
  66. Syntax:    setPrintableMargins document
  67.  
  68. This command sets the margins of a document object equal to the maximum printable area supported by the current print settings. Since this command changes the whole coordinate system of the document, your document must be empty when you call setMargins. Call reset on your document beforehand just to make sure. After calling setPrintableMargins, you can use the getMargins routine to check the results.getPageWidth
  69.  
  70. Syntax:    getPageWidth(document)
  71.  
  72. Returns: the distance between the left and right margins, in points
  73.  
  74. This function returns the width of a document's "live area", the distance between the left and right margins of the document.
  75.  
  76. Example:
  77.  
  78. It is often convenient to retrieve the dimensions of the live area of a document and store them in Lingo variables for use in subsequent calculations. The following example creates two linked frames on the page, for formatting printed output into two columns.
  79.  
  80.     -- create two new frames on the page
  81.     -- with 1/2 inch (36 points) in between
  82.     set w = getPageWidth(doc)
  83.     set h = getPageHeight(doc)
  84.     newFrame doc, Rect(0,0,(w/2)-18,h), TRUE
  85.     newFrame doc, Rect(0,0,(w/2)+18,h), TRUEgetPageHeight
  86.  
  87. Syntax:    getPageHeight(document)
  88.  
  89. Returns: the distance between the top and bottom margins, in points
  90.  
  91. This function returns the height of a document's "live area", the distance between the top and bottom margins of the document.
  92.  
  93. Example:
  94.  
  95. It is often convenient to retrieve the dimensions of the live area of a document and store them in Lingo variables for use in subsequent calculations. The following example creates two linked frames on the page, for formatting printed output into two columns.
  96.  
  97.     -- create two new frames on the page
  98.     -- with 1/2 inch (36 points) in between
  99.     set w = getPageWidth(doc)
  100.     set h = getPageHeight(doc)
  101.     newFrame doc, Rect(0,0,(w/2)-18,h), TRUE
  102.     newFrame doc, Rect(0,0,(w/2)+18,h), TRUEgetPaperWidth
  103.  
  104. Syntax:    getPaperWidth(document)
  105.  
  106. Returns: the width of the physical paper, in points
  107.  
  108. This function returns the width of the physical piece of paper that the current document is configured to print on.getPaperHeight
  109.  
  110. Syntax:    getPaperHeight(document)
  111.  
  112. Returns: the height of the physical paper, in points
  113.  
  114. This function returns the height of the physical piece of paper that the current document is configured to print on.