ADC Home > Reference Library > Technical Notes > Legacy Documents > Printing >
Important: This document is part of the Legacy section of the ADC Reference Library. This information should not be used for new development.
Current information on this Reference Library topic can be found here:
|
PostScript documentationDate Written: 7/13/90 Last reviewed: 8/1/92 Adobe Systems publishes three great manuals that can help you with PostScript commands: PostScript Language Reference Manual, PostScript Language Tutorial, and PostScript Language Cookbook. You can find these manuals at just about any bookstore, or you can order them through APDA by calling (800) 282-2732 or writing them at:
Apple Computer, Inc. AppleTalk packets and PostScriptHandle PicCommentDate Written: 8/7/90 Last reviewed: 8/1/92
What's the optimal amount of PostScript to pass in
There is no one optimal size that your Using PostScript to control LaserWriter serial I/ODate Written: 12/6/90 Last reviewed: 3/28/93 Where can I find information on using PostScript to control a multi-tray sheet feeder by communicating through the LaserWriter serial port? You need to talk with Adobe on how they control the serial chip with PostScript. They use some undocumented PostScript calls to control the serial chip on the controller board of the LaserWriter. They can be reached at:
Adobe Systems, Inc. or AppleLink Address: ADOBE.SUPT (Tech Support) Details about installing feeder resources for Macintosh into the LaserWriter driver 7.0 dialogs are available in the Macintosh Technical Note "Feeder Fodder." How to inhibit LaserWriter test pageDate Written: 12/24/90 Last reviewed: 8/1/92 How do I inhibit the test page on a LaserWriter?
The above commands can be downloaded from your Macintosh to the printer several ways:
When you issue the commands, your LaserWriter will probably crank and grind for a few seconds (it has to re-program the EPROM inside) then after the lights stop flashing, your LaserWriter will no longer spit out the startup page until you enable the setdostartpage flag again (in other words, this isn't a permanent change). For more information on the above subject we recommend the PostScript Language Reference Manual by Adobe Systems. Where to find Encapsulated PostScript file (EPSF) documentationDate Written: 4/5/91 Last reviewed: 8/1/92 I'm developing an application that creates pictures containing both QuickDraw and PostScript (as picComments). How do I create an encapsulated PostScript file (EPSF)? Is the format explained anywhere, and is it possible to convert the QuickDraw into PostScript directly in the application? Adobe's EPSF format is documented in the new (2nd) edition of Adobe's PostScript Language Reference Manual (Addison-Wesley) and in "Adobe Document Structuring Conventions," available from Adobe Systems. Adobe's references explain how to structure your comments in your PostScript file so that other applications know how to read it. You probably don't want to try to convert QuickDraw to PostScript directly in your application, although it is possible. Basically, it involves translating each QuickDraw command into PostScript, which is what the LaserWriter Driver does. It's a lot of work and makes you dependent on the QuickDraw features being used, which can be a problem when new features are added. PostScript setprintername doesn't accept colons in stringDate Written: 4/16/91 Last reviewed: 8/1/92
Why can't I use a colon with the PostScript command
The reason that the Personal LaserWriter NT is not accepting the PostScript
you're sending is not because of a bug, but rather a bug fix. Colons have never
been acceptable in the string passed to If you need to change the LaserWriter network type, it can be done with the AppleTalk-type parameter described on page 105 of Apple's LaserWriter Reference manual. This method will work on the new printers as well as the old. PostScript code for renaming LaserWriterDate Written: 6/5/91 Last reviewed: 8/1/92 In checking a printer name to ensure an even number of characters, does the LaserWriter Namer append a space to the end if the total is odd? In a nutshell, yes. The Namer does indeed append an extra space to odd-length printer names. The reasoning behind this is to be compatible with some of the old 68000 processors. The addressing scheme of these old processors requires that memory be accessed by even-numbered addresses. To get at a piece of memory located after an odd-length LaserWriter name, you would need to get an odd-numbered address (which is not directly possible). This obviously can be worked around, but the authors of the Namer felt it best to avoid this altogether by padding the name when necessary. It's worth noting that the version 7.0 Namer does this too. If you'd like to work around this, here's an alternate method for renaming the printer: The printer name is stored as a string in the persistent parameters of all LaserWriters. This string can be changed by the following PostScript program:
Replace This program can be downloaded to the LaserWriter in batch or interactive mode. In interactive mode you should type both command strings on the same line before pressing Enter, because exitserver disconnects you from the printer. When you reestablish your connection to the printer, the name will be changed. Make sure you have selected the correct LaserWriter using the Chooser before downloading this program, so you don't rename the wrong LaserWriter. Printing 2-byte bitmap fonts on PostScript LaserWritersDate Written: 9/29/91 Last reviewed: 8/1/92 The Macintosh Technical Note #91 refers to using QuickDraw picComments to print rotated text, but this doesn't work for 2-byte Japanese text. Is there a recommended workaround for this problem?
Two-byte characters don't print when using the
Since the data is in bitmap format, you can use the
The tricky part of the solution is that you only need to use this approach when
you're printing 2-byte Japanese bitmap fonts. Therefore, you'll need to check
the type of data that is to be printed, and send the appropriate
You can also use the following
The
There is one problem with the previously mentioned solution: If you record the
previous
Neither solution is ideal. Quite a few applications out in the market today have decided to use idea #2. Macintosh spooling should be device independentDate Written: 1/1/90 Last reviewed: 8/1/92 How can I tell whether the chosen printer supports PostScript or not?
There is no supported method for determining whether or not a device speaks
PostScript. Apple engineering would like all Macintosh applications to spool
both PostScript and QuickDraw regardless of the chosen printer, so that the
spool file is device-independent and can be redirected after spooling. Since
engineering is strongly encouraging developers to spool both models, it is
doubtful that Apple will be providing a query mechanism in the future. The best
method is to assume PostScript is available, and format your document based on
information returned by LaserWriter driver and PostScript showpageDate Written: 1/1/90 Last reviewed: 6/14/93 When I print a PostScript file, why do I get one blank page for every page printed?
Your PostScript file probably contains calls to the PostScript
the LaserWriter driver will handle calling PicComment TextIsPostScript versus PostScriptHandleDate Written: 1/1/90 Last reviewed: 6/14/93 When using the Macintosh TextIsPostScript picture comment, my PostScript code is also "printed" on the ImageWriter. Why isn't it ignored?
One of the comments,
To avoid this problem, developers should use the
First, there is no QuickDraw/PostScript interaction. For example, early
versions of the LaserWriter driver sent the strings passed to
The other reason for using the X-Ref: Macintosh Technical Note "How To Produce Continuous Sound Without Clicking" How to send PostScript from the Macintosh to the LaserWriterDate Written: 5/3/89 Last reviewed: 6/14/93 How do I send PostScript from the Macintosh to the LaserWriter?
The best method for sending PostScript to the LaserWriter is to use the
The described fragment prints a line on any type of printer, PostScript or not.
The first Converting PostScript file to Encapsulated PostScriptDate Written: 5/19/92 Last reviewed: 6/14/93 What needs to be added to an ordinary PostScript file to convert it to an Encapsulated PostScript (EPS) file? The latest Adobe "red book," PostScript Language Reference Manual (2nd Edition), has the information you need. Appendix H: Encapsulated PostScript File Format Version 3.0 describes the contents of an EPS file. Appendix G: Document Structuring Conventions specifies the single-page document PS file, which must include at least these two comments:
You might find the following references from Adobe useful as well: Adobe Illustrator Document Format Specification v2.0 (Adobe Technical Note #LPS5007) Encapsulated PostScript Files v1.2 (Adobe Technical Note #LPS5002) You can reach Adobe at:
Corporate Headquarters Macintosh Technical Note "Picture Comments--The Real Deal" (formerly #91) contains sample code for using all of the supported Picture Comments. Printing halftone images on the LaserWriterDate Written: 5/3/89 Last reviewed: 8/1/92 How can I print halftone images on the LaserWriter? How do I use the PostScript "image" operator for printing halftones?
The PostScript "image" operator is similar to the Macintosh QuickDraw About image: The PostScript image operator is used to send bitmaps or pixmaps to the LaserWriter. The image operator can handle depths from one to eight bits per pixel. Our current LaserWriters can image only about 16 shades of gray, but the printed page will look like there's more. Because the image operator is still a PostScript operator, it expects its data in the form of hexadecimal bytes. The bytes are represented by two ASCII characters("0"-"9," "A"-"F") per byte. The image operator takes these parameters: width height depth matrix image-data. The first three are the width, height, and depth of the image, and the matrix is the transformation matrix to be applied to the current matrix. See the PostScript Language Reference Manual for more information. The image data is where the actual hex data should go. Instead of inserting the data between the first parameters and the image operator itself, it is better to use a small PostScript procedure to read the data starting right after the image operator. For example:
In the preceding example, the width of the image is 640, the height is 480, and the depth is 8. The matrix (enclosed in brackets) is set up to draw the image starting at QuickDraw's 0,0(top left of page), and with no scaling. The PostScript code (enclosed in braces) is not executed. Instead, it is passed to the image operator, and the image operator calls it repeatedly until it has enough data to draw the image. In this case, it is expecting 640*480 bytes. When the image operator calls the procedure, it does the following:
Using the above PostScript code you can easily print an image. Just fill in the width height and depth, and send the hex data immediately following the PostScript code. Setting up for image: Most of the users of this technique are going to want to print a Color QuickDraw pixmap. Although the image command does a lot of the work for you, there are still a couple of tricks for performance:
Assume the maximum depth: Since the current version of the image operator has a
maximum depth of eight bits/pixel, it is wise to convert the source image to
the same depth before imaging. You can do this very simply by using an
offscreen
Build a color table: An eight bit deep image can use only 256 colors. Since the
image that you are starting with is probably color, and the image you get will
be grayscale, you need to convert the colors in the source color table into
PostScript grayscale values. This is actually easy to do using the Color
Manager. First create a table that can hold 512 bytes. This is two bytes for
each color value from 0 to 255. Since PostScript wants the values in ASCII, you
need two characters for each pixel. Now loop through the colors in the color
table. Call
Sending the data: Once you have set up the color table, all that's left to do
is loop through all of the pixels, and send their PostScript representation to
the LaserWriter. There are a couple of ways to do this. One is to use the
low-level Print Manager interface and stream the PostScript using the X-Ref: PostScript Language Reference Manual, Adobe Systems. Downloadables
|
|