home *** CD-ROM | disk | FTP | other *** search
/ Painter Bear's Language Bridge — Italian / Bridge_ponte_itialian.iso / pc / xtras / -pmatic.dir / docs_10.txt < prev    next >
Encoding:
Text File  |  1999-09-22  |  8.0 KB  |  140 lines

  1. Creating Frames and Appending their Contents
  2.  
  3. The PrintOMatic Xtra uses a "frames" metaphor for creating areas on the page where text or graphics can be flowed. The basic procedure is to create one or more "linked" frames on a page of a document, then append items to the newly created frames. The following commands are used to create frames and append their contents.
  4.  
  5.     newFrame             creates a new frame on the current page
  6.     append                appends contents to the current frame
  7.     appendFile            appends the contents of a text or graphic file to the current frame
  8.     getInsertionPoint     gets the location of the insertion point within the current frame
  9.     
  10.  
  11. newFrame 
  12.  
  13. Syntax:    newFrame document, rect, linkedToPrevious
  14.  
  15. The newFrame command adds a new "frame" to the current page of the document, and makes it the "current" frame. Text and graphic items can be flowed into the current frame using the append and appendFile commands. 
  16.  
  17. The linkedToPrevious parameter determines whether the contents of the previous frame will flow into the new frame once the previous frame is filled. When you create a new frame that is not linkedToPrevious,  you can no longer append items to the previously "current" frame. Also note that you cannot link frames between the master page and a body page. 
  18.  
  19. append 
  20.  
  21. Syntax:    append document, member whichCastmember [, ... , autoAppend ]
  22.           append document, member whichCastmember of castLib whichLib
  23.                  [, ... , autoAppend ]
  24.           append document, castLib whichCast [, ... , autoAppend ]
  25.           append document, sprite whichSprite [, ... , autoAppend ]
  26.           append document, string [, ... , autoAppend ]
  27.           append document, list [, ... , autoAppend ]
  28.  
  29. The append command appends one or more items to the current "frame" of a PrintOMatic document. If no current frame exists in your document, the PrintOMatic Xtra will attempt to create a "default" frame for you, which is the width and height of the page, minus the current margins.
  30.  
  31. The autoAppend parameter, which is always the last parameter in a call to append, controls whether or not new pages will be created "on the fly" if the PrintOMatic Xtra runs out of space on the last "frame" in your document. If this parameter is set to TRUE, new pages will be created with the same "frame" layout as the last page of your document. PrintOMatic will create as many new pages as are necessary to flow all the specified elements into your document . If this parameter is not specified when you call append, its value defaults to TRUE.
  32.  
  33. AutoAppending is not allowed when flowing items into a frame on the master page of a document.
  34.  
  35. type of object          what gets appended
  36. _________________________________________________________________
  37.  
  38. text field cast member  the text of the field, using the 
  39.                         specified fonts and styles
  40.  
  41. rich text cast member   the bitmap image of the cast member,
  42.                         including anti-aliasing
  43.  
  44. bitmap cast member      the cast member graphic
  45.  
  46. PICT cast member        the cast member graphic
  47.  
  48. cast library            all printable cast members in the 
  49.                         library, in cast sequence
  50.  
  51. sprite                  the cast member of the sprite
  52.  
  53. text string             the text string, in the default font 
  54.                         (Geneva 10pt on Macintosh, 
  55.                         Arial 10pt on Windows)
  56.  
  57. list                    the elements in the list
  58.  
  59. Example:
  60.  
  61. The following example creates a PrintOMatic document, sets the document name, creates the first page, adds a frame to it, and appends a number of items to the document, and prints it:
  62.  
  63.     set doc = new(xtra "PrintOMatic")
  64.     if not objectP(doc) then exit
  65.     setDocumentName doc, "My Example Document"
  66.     newPage doc
  67.     newFrame doc, Rect(0,0,getPageWidth(doc),getPageHeight(doc)
  68.     append doc, sprite 1, TRUE
  69.     append doc, [member "image", member "caption", sprite 5], TRUE
  70.     append doc, castLib "printout", TRUE
  71.     if doJobSetup(doc) then print doc
  72.     set doc = 0
  73.  
  74.  
  75. appendFile
  76.  
  77. Syntax:    appendFile document, fileName [, ... , autoAppend ]
  78.  
  79. The appendFile command appends one or more text or graphics files to the current "frame" of a PrintOMatic document. If no current frame exists in your document, the PrintOMatic Xtra will attempt to create a "default" frame for you, which is the width and height of the page, minus the current margins.
  80.  
  81. For details on how to use the autoAppend parameter, please see the for the append command.
  82.  
  83. The following file formats are supported by appendFile. The actual format of the file will be auto-detected by the appendFile command.
  84.  
  85. file type    notes
  86. _________________________________________________________________
  87.  
  88. plain text      Normal ASCII format text, with or 
  89.                 without DOS line-feed characters
  90.  
  91. styled text     (Macintosh only) Macintosh ASCII text 
  92.                 file with a 'styl' resource, such as 
  93.                 files created by SimpleText
  94.  
  95. EPS             Encapsulated PostScript file, with or 
  96.                 without a preview image
  97.  
  98. PICT            Macintosh PICT format file (only raster 
  99.                 PICT files supported on Windows)
  100.  
  101. BMP             (Windows only) BMP files of any 
  102.                 bit depth
  103.  
  104. Notes on Printing EPS Files
  105.  
  106. You should avoid using EPS files if you want your printing code to work reliably with all types of printers. Many, many popular printers attached to Macintosh and Windows PC's DO NOT support PostScript printing. The output that PrintOMatic generates on these types of printers can vary from low-resolution bitmaps to placeholder boxes to nothing at all.
  107.  
  108. Assuming you decide not to heed this warning, here are some tips that may improve your success.
  109.  
  110. Many applications that generate EPS files allow you to create files in "ASCII" or "binary" format. PrintOMatic prints ASCII format PostScript files MUCH more reliably than binary files. Under some conditions, PrintOMatic will print binary PostScript files just fine. However, certain types of printer connections work very poorly with binary PostScript. Specifically, serial printers that use XON/XOFF flow control often mistake binary data for flow control codes, and will seriously garble or crash your print job.
  111.  
  112. Some types of PostScript files, notably those generated by using the "print to disk" feature of the LaserWriter driver, don't contain "bounding box" information. PrintOMatic needs bounding box information to determine the size of a PostScript  image for placement on the page, and will generate an error if this information can't be found.
  113.  
  114. You can manually add bounding box information to PostScript files using a text editing program. Insert the following line of text into the file somewhere between the !%PS-Adobe-3.0 and %%EndComments lines at the beginning of the file, substituting the width and height of the page (in points) for the 'x' and 'y' values:
  115.  
  116.     %%BoundingBox: 0 0 x y
  117.  
  118. Finally, keep in mind that PostScript is a programming language with a broad set of features, some of which are supported differently by different printers. This makes EPS files MUCH more prone to printing errors and incompatibilities than other file formats, such as PICT or BMP. This is another good reason to avoid using EPS files if at all possible. 
  119.  
  120.  
  121. getInsertionPoint
  122.  
  123. Syntax:    getInsertionPoint(document)
  124.  
  125. Returns:   A string in the format "page, x, y", or VOID if there is no insertion point.
  126.  
  127. The getInsertionPoint function returns the page number and coordinates at which the next append or appendFile command will insert new content into the document. This can be useful for deciding when to manually break pages, or allow you to place graphics in the margins of a document next to accompanying text.
  128.  
  129. Example:
  130.  
  131. The following code checks for an insertion point, and if there is one, places a graphic in the margin next to the insertion point:
  132.  
  133.     set the itemDelimiter = ","
  134.     set insPt = getInsertionPoint(doc)
  135.     if stringP(insPt) then
  136.        drawPicture member "dingbat", Point(-10, integer(item 3 of insPt))
  137.     end if
  138.  
  139.  
  140.