home *** CD-ROM | disk | FTP | other *** search
/ Painter Bear's Language Bridge — Italian / Bridge_ponte_itialian.iso / pc / xtras / -pmatic.dir / docs_6.txt < prev    next >
Encoding:
Text File  |  1999-09-22  |  7.4 KB  |  144 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. 
  17.  
  18.  
  19. setDocumentName
  20.  
  21. Syntax:    setDocumentName document, name
  22.  
  23. 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.
  24.  
  25.  
  26. setLandscapeMode
  27.  
  28. Syntax:    setLandscapeMode document, trueOrFalse
  29.  
  30. This command switches the page orientation of a PrintOMatic document 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.
  31.  
  32. In Windows, this method works in a very straightforward manner: call it, and the landscape mode changes.
  33.  
  34. Unfortunately, it's an entirely different story on the Macintosh. 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.
  35.  
  36. To get around this, PrintOMatic for the Macintosh 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.
  37.  
  38. 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.
  39.  
  40. 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.
  41.  
  42. 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.
  43.  
  44.  
  45. getLandscapeMode
  46.  
  47. Syntax:    getLandscapeMode(document)
  48.  
  49. Returns:    TRUE if the document has a landscape orientation, otherwise FALSE
  50.  
  51. This command retrieves the page orientation of a PrintOMatic document. getLandscapeMode returns TRUE if the document has a landscape (horizontal) orientation. 
  52.  
  53.  
  54. setMargins
  55.  
  56. Syntax:    setMargins document, marginRect
  57.  
  58. This command sets the margins of a PrintOMatic document. 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.
  59.  
  60. Example:
  61.  
  62. 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.
  63.  
  64.     set doc = new(xtra "PrintOMatic")
  65.     if not objectP(doc) then exit
  66.     setMargins doc, Rect(144,72,72,72)
  67.  
  68.  
  69. getMargins
  70.  
  71. Syntax:    getMargins(document)
  72.  
  73. Returns:    the document margins, in Lingo Rect format
  74.  
  75. This command retrieves the margins of a PrintOMatic document. 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). 
  76.  
  77.  
  78. setPrintableMargins
  79.  
  80. Syntax:    setPrintableMargins document
  81.  
  82. This command sets the margins of a PrintOMatic document 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.
  83.  
  84.  
  85. getPageWidth
  86.  
  87. Syntax:    getPageWidth(document)
  88.  
  89. Returns:   the distance between the left and right margins, in points
  90.  
  91. This function returns the width of a document's "live area", the distance between the left and right 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), TRUE
  103.  
  104.  
  105. getPageHeight
  106.  
  107. Syntax:    getPageHeight(document)
  108.  
  109. Returns:   the distance between the top and bottom margins, in points
  110.  
  111. This function returns the height of a document's "live area", the distance between the top and bottom margins of the document. 
  112.  
  113. Example:
  114.  
  115. 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.
  116.  
  117.     -- create two new frames on the page
  118.     -- with 1/2 inch (36 points) in between
  119.     set w = getPageWidth(doc)
  120.     set h = getPageHeight(doc)
  121.     newFrame doc, Rect(0,0,(w/2)-18,h), TRUE
  122.     newFrame doc, Rect(0,0,(w/2)+18,h), TRUE
  123.  
  124.  
  125.  
  126. getPaperWidth
  127.  
  128. Syntax:    getPaperWidth(document)
  129.  
  130. Returns:   the width of the physical paper, in points
  131.  
  132. This function returns the width of the physical piece of paper that the current document is configured to print on. 
  133.  
  134.  
  135. getPaperHeight
  136.  
  137. Syntax:    getPaperHeight(document)
  138.  
  139. Returns:   the height of the physical paper, in points
  140.  
  141. This function returns the height of the physical piece of paper that the current document is configured to print on. 
  142.  
  143.  
  144.