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.
newFrame creates a new frame on the current page
append appends contents to the current frame
appendFile appends the contents of a text or graphic file to the current frame
getInsertionPoint gets the location of the insertion point within the current frame
newFrame
Syntax: newFrame document, rect, linkedToPrevious
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.
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.
append
Syntax: append document, member whichCastmember [, ... , autoAppend ]
append document, member whichCastmember of castLib whichLib
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.
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.
AutoAppending is not allowed when flowing items into a frame on the master page of a document.
text field cast member the text of the field, using the
specified fonts and styles
rich text cast member the bitmap image of the cast member,
including anti-aliasing
bitmap cast member the cast member graphic
PICT cast member the cast member graphic
cast library all printable cast members in the
library, in cast sequence
sprite the cast member of the sprite
text string the text string, in the default font
(Geneva 10pt on Macintosh,
Arial 10pt on Windows)
list the elements in the list
Example:
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:
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.
For details on how to use the autoAppend parameter, please see the for the append command.
The following file formats are supported by appendFile. The actual format of the file will be auto-detected by the appendFile command.
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.
Assuming you decide not to heed this warning, here are some tips that may improve your success.
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.
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.
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:
%%BoundingBox: 0 0 x y
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.
getInsertionPoint
Syntax: getInsertionPoint(document)
Returns: A string in the format "page, x, y", or VOID if there is no insertion point.
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.
Example:
The following code checks for an insertion point, and if there is one, places a graphic in the margin next to the insertion point:
set the itemDelimiter = ","
set insPt = getInsertionPoint(doc)
if stringP(insPt) then
drawPicture member "dingbat", Point(-10, integer(item 3 of insPt))