Documentation Archive Developer
Search

ADC Home > Reference Library > Technical Notes > Legacy Documents > Printing >

Legacy Documentclose button

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:

Using Laser Prep Routines

CONTENTS

This technical note addresses the issues involved in depending on the procedures and constants defined in the Laser Prep dictionary.

[July 01 1987]






Introduction

When you are writing an application that uses PostScript heavily, it is very tempting to call the procedures already defined in the Laser Prep dictionary, rather than taking up the space in the printer's memory with PostScript procedures of your own. Or, if a procedure in the dictionary doesn't do what you need it to do, it is tempting to go in and change it to do what you really want.

Unfortunately, we cannot guarantee that either the name or the function of a particular procedure in the dictionary will stay the same when the LaserWriter driver changes. In addition, some procedures may become obsolete and go away when the driver changes. Since the Laser Prep dictionary is considered part of the source for the LaserWriter driver, Apple reserves the right to make any changes to it that are deemed necessary.

Because we cannot guarantee the permanence of the contents of the Laser Prep dictionary, relying on its contents can pose a significant compatibility problem. If you rely on the procedures defined in the Laser Prep dictionary, your application will have to be revised every time Apple releases a new LaserWriter driver.

If you feel that you absolutely must use or modify procedures in the Laser Prep dictionary, you must always check the version that is loaded into the printer before you print. This allows your application to take appropriate action if the version of the dictionary that has been downloaded to the printer isn't one that you know about.

Back to top

How To Check The Laser Prep Dictionary Version

To determine the version of Laser Prep that the printer may contain, you have to communicate with the printer using the Printer Access Protocol (PAP); you can't just send your query through the LaserWriter driver because there is no way to get an answer back. The object code and documentation for PAP are available from Apple's Licensing department.

To determine whether the dictionary has been downloaded and whether it is the right one, send the following PostScript code to the printer:

    %!PS-Adobe-1.2 Query
    %%Title: Query to establish Laser Prep ProcSet version propriety
    %%?BeginProcSetQuery: AppleDict md xx
    /md where{
    /md get /av get cvi xx eq
    {(1)}{(2)}ifelse}
    {(0)}ifelse = flush
    %%?EndProcSetQuery: unknown

md is the name of the Apple dictionary and xx is the version number you want.


Note:
/av is a constant in the md dictionary which contains the dictionary's version number. This is the only object in the dictionary whose name and function are guaranteed not to change.


From the printer you will receive a string. If the string returned begins with "%%," it is a Status response. You can ignore it and wait for another string.

If the response is "0," the dictionary hasn't been downloaded yet; you will need to determine how to best handle this situation for your application.

If the response is "1," the printer is loaded with the correct version of the dictionary.

If the response is "2," then the dictionary exists but it isn't the version you need. In this case you need to either let the user know, or proceed in as standard a fashion as possible, without calling or modifying routines contained in the Laser Prep dictionary.

Back to top

Translating PostScript Files

Some applications interpret the PostScript files that are generated by the LaserWriter driver when the user presses Command-F (generates document only) or Command-K (generates dictionary and document) after clicking on the OK button in the Job dialog. A typical application might translate these PostScript files into another page description language.

This kind of application requires intimate knowledge of the contents of the dictionary in order to be able to do the translation, because it may have to expand the procedures used to their actual values before it can then translate the PostScript to another language. This poses a significant compatibility problem. Since we cannot guarantee that the contents of the dictionary will not change, these types of applications will have to be revised every time we release a new version of the LaserWriter driver. Also, there is no way to know which version of the LaserWriter driver generated the PostScript file the application is interpreting. You will have to require that a particular version of the LaserWriter driver be used to generate the PostScript files that your application will interpret.

Back to top

Printer Independence

Applications that are written to take advantage of the routines in the Laser Prep dictionary are, of course, highly device dependent. Being device dependent can drastically reduce your chances of being compatible with future printer-type devices. For a more detailed discussion of this issue, please refer to Technical Note #122.

Back to top

References

The Printing Manager

PostScript Language Reference Manual

Technical Note M.IM.DevIndPrinting -- Device-Independent Printing

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (48K).

Download