Important: The information in this document is obsolete and should not be used for new development.
About Picture Comments
Within the drawing code sent to a printer driver after your application uses thePrOpenPage
procedure, your application can specify picture comments by using the QuickDrawPicComment
procedure. ThePicComment
procedure allows your application to pass data or commands directly to an output device.
PROCEDURE PicComment (kind: Integer; dataSize: Integer; dataHandle: Handle);Thekind
parameter specifies the kind of picture comment, and thedataSize
parameter specifies the size of the data referred to by thedataHandle
parameter. (For some picture comments, the values passed in thedataSize
anddataHandle
parameters should be 0 andNIL
, respectively.)You typically use a picture comment to give your application and an output device additional control over the rendering of images. A number of picture comments have been given special definitions by various printer drivers. When a printer driver encounters one of these comments, it interprets the comment as an appropriate drawing operation. A PostScript printer driver, for example, may convert a picture comment into PostScript code.
By including picture comments in your code that draws into a printing graphics port, your application can rotate text and graphics, smooth polygons, draw hairlines, create dashed lines, and pass PostScript code directly to the printer driver. (For information about the PostScript language, see the PostScript Language Reference Manual, second edition, published by Addison-Wesley.)
Picture comments were initially designed to allow applications to share data in the form of QuickDraw pictures (as described in the chapter "Pictures" in this book). With the advent of the PostScript LaserWriter printer, the use of picture comments was extended to allow applications to more easily take advantage of various PostScript features unavailable with QuickDraw.
However, you do not need to create a QuickDraw picture to use picture comments for printing. When your application calls the Printing Manager procedure
PrOpenPage
, the printer driver collects your drawing operations after they are handled by the low-level drawing routines contained in theQDProcs
record for the printing graphics port. As explained in the chapter "QuickDraw Drawing" in this book, the default low-level procedure specified by QuickDraw in thecommentProc
field of theQDProcs
record is theStdComment
procedure, which simply ignores picture comments. However, a printer driver can replace theStdComment
procedure with its own routine for handling picture comments.
When you use the
- WARNING
- As described in the chapter "Pictures" in this book, do not call the
OpenCPicture
orOpenPicture
function between calls toPrOpenPage
andPrClosePage
.PicComment
procedure after callingPrOpenPage
and before callingPrClosePage
, the printer driver either ignores the picture comment passed toPicComment
or collects the results of its drawing operations, depending on whether the printer driver has installed its own low-level drawing routine that handles the picture comment.Although the
PicComment
procedure is available on all Macintosh computers, the availability of the drawing operations that you can implement with picture comments depends on the driver for the current printer. The inability to determine which picture comments are supported by the current printer driver means that if you use picture comments to perform drawing operations not supported by QuickDraw, you must also provide for printing on QuickDraw-only printers.This requires your application to maintain separate code branches: for example, one that takes advantage of the picture comment handling of a PostScript printer driver, and another for a printer driver that supports only QuickDraw. Furthermore, you must hide the code that takes advantage of PostScript printer drivers from QuickDraw-based drivers, and you must hide from PostScript drivers the code that uses QuickDraw-based approximations of these drawing operations. Your application's printed output will necessarily differ depending on the driver for the current printer.
Table B-1 lists picture comments defined for various printer drivers produced by Apple and used by third-party producers of various other printer drivers. For each picture comment, this table shows the name of the picture comment that you specify in the
kind
parameter of thePicComment
procedure, the value represented by the name, the value for thedataSize
parameter, and the value for thedataHandle
parameter. (Be sure to dispose of the memory you allocate for any handle you pass in thedataHandle
parameter.) Keep in mind that it is impossible to determine which picture comments are supported by the driver of the current printer.All PostScript LaserWriter drivers support the picture comments listed in Table B-1.
Some third-party QuickDraw printer drivers support the
TextBegin
,TextCenter
, andTextEnd
picture comments.The QuickDraw LaserWriter SC driver supports the
LineLayoutOff
,LineLayoutOn
, andSetLineWidth
picture comments.The QuickDraw ImageWriter LQ driver and versions prior to 7.2 of the QuickDraw StyleWriter driver support the
LineLayoutOff
andLineLayoutOn
picture comments.The QuickDraw Personal LaserWriter LS driver and versions later than 7.2 of the QuickDraw StyleWriter driver support no picture comments at all.
The
SetGrayLevel
picture comment is now obsolete. ThePostScriptFile
,TextIsPostScript
,FormsPrinting
,EndFormsPrinting
,ClientLineLayout
,PSBeginNoSave
, andResourcePS
picture comments have limited use and are no longer recommended.See Advanced Color Imaging on the Mac OS for information about the picture comments used by the ColorSync Utilities.