Version: 1.0

Posted: 2006-07-18

Build Requirements: Xcode 2.3

Runtime Requirements: Mac OS X 10.3 Panther

View Source Code:

Download Sample (“PMPrinterPrintWithFile.zip”, 53.1K)
Download Sample (“PMPrinterPrintWithFile.dmg”, 113.1K)



Description

The PMPrinterPrintWithFile API allows applications to send files directly to the printer. One of the parameters for PMPrinterPrintWithFile is a mime type, depending on this mime type the print system may or may not do post processing on the file you are sending. For example, if you want to generate all the PostScript data for your print job you need submit a fully formed PostScript job using the PMPrinterPrintWithFile function and use the mime type application/vnd.cups-postscript. If the same file is submitted using the mime type application/postscript, the printing system uses the page format, print settings you provide in other parameters, in addition to the printer PPD file to insert the appropriate PostScript data into the print stream. This is done automatically by the pstops filter that runs as part of printing.

Use PMPrinterGetMimeTypes() to check whether a mime type is supported by the printer you are targeting.

Mime Type Examples

–application/postscript // We insert the PS for the PMPrintSettings into the PostScript stream.

–application/vnd.cups-postscript // Raw postscript/finished postscript. We don't insert anything

–application/pdf // PDF document

–image/gif, image/jpeg, image/tiff // Images

–text/plain, text/rtf, text/html // Text

–application/vnd.cups-raw //Raw printer commands and escape codes, mainly for the printer venders

–And more...

The pict-ps printing path is deprecated, and the recommended way to send PostScript to the printer is using PMPrinterPrintWithFile. The pict-ps printing path is not available on Intel-based Macintosh clients for print jobs.

Document Revision History

Date Notes
2006-07-18How to send files, for example PostScript and PDF, directly to the printer. Replaces the pict-ps path.

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.