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:

Document Names and the Printing Manager

CONTENTS

[Jul 01 1987]






Introduction

Our compatibility testing for LaserShare (Apple's LaserWriter spooler) has turned up a number of applications that do not provide the Printing Manager with a document name; although this feature is not required, it is nice for users that share printers.

Some printers (usually those that are shared between many users, like the LaserWriter) can provide the names of the users who are printing and the documents that are being printed to others interested in using the printer.

If the chosen printer uses a document name, the Printing Manager gets the name from the frontmost window's title. If there is no front window, or if the window's title is empty, the Printing Manager defaults to "unknown."

This method was chosen because it works most transparently to applications; however, it won't work if your application doesn't display windows when printing (for instance, many applications that use windows for their documents do not open their documents when printing in response to a Finder "Print" command).

As a general solution to this problem, you can put up a window containing a message like "Press Cmd-. to cancel printing", and give it the document's title. If the window is one that doesn't have a title bar (like dBoxProc), this title will not be displayed. MacApp takes this approach. If for some reason you don't want to put up a visible window, you can create a tiny window and hide it behind the menu bar: for instance, global coordinates of (1,1,2,2). Make sure you use a plainDBox, so that no title will be drawn (otherwise, in the unlikely case that a user is using a Macintosh II with two stacked screens, main screen on the bottom, the title might be visible on the upper screen).

Since the Printing Manager checks the name at PrValidate time, call PrValidate after PrCloseDoc and before the next PrOpenDoc, if you want unique names.

A number of applications set the document name in the print record directly. You should not do this because a) not all printers support this field, and b) none are guaranteed to support it in the future. (Apple does not guarantee that internal fields of the Printing Manager's data structures will remain the same; the Printing Manager is targeted for substantial internal change!)

Back to top

References

The Printing Manager

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

Back to top

Downloadables

Acrobat gif

Acrobat version of this Note (44K).

Download



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.