Tips for Working with Postscript Printer Driver for Macintosh

Tips for Working with Postscript Printer Driver for Macintosh

® Tips for Working with the New PostScript Printer ®®Driver for Macintosh Adobe Developer Support Technical Note #5134 2 April 1993 Adobe Systems Incorporated Adobe Developer Technologies 345 Park Avenue San Jose, CA 95110 http://partners.adobe.com/ PN LPS5134 Copyright 1993 by Adobe Systems Incorporated. All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written consent of the publisher. Any software referred to herein is furnished under license and may only be used or copied in accordance with the terms of such license. PostScript is a registered trademark of Adobe Systems Incorporated. All instances of the name PostScript in the text are references to the PostScript language as defined by Adobe Systems Incorpo- rated unless otherwise stated. The name PostScript also is used as a product trademark for Adobe Sys- tems’ implementation of the PostScript language interpreter. Any references to a “PostScript printer,” a “PostScript file,” or a “PostScript driver” refer to printers, files, and driver programs (respectively) which are written in or support the PostScript language. The sentences in this book that use “PostScript language” as an adjective phrase are so constructed to rein- force that the name refers to the standard language definition as set forth by Adobe Systems Incorpo- rated. Adobe, PostScript, the PostScript logo, and Display PostScript are trademarks of Adobe Systems Incorporated which may be registered in certain jurisdictions. Apple, AppleTalk, LaserWriter, Mac, and Macintosh are registered trademarks and QuickDraw is a trademark of Apple Computer, Inc. This publication and the information herein is furnished AS IS, is subject to change without notice, and should not be construed as a commitment by Adobe Systems Incorporated. Adobe Systems Incorpo- rated assumes no responsibility or liability for any errors or inaccuracies, makes no warranty of any kind (express, implied or statutory) with respect to this publication, and expressly disclaims any and all warranties of merchantability, fitness for particular purposes and noninfringement of third party rights. Contents Tips for Working with the New PostScript Printer Driver for Macintosh 5 1 Introduction 5 Who Should Read This Document 5 2New Driver Overview 6 3Driver Architecture 8 2 Pass design 8 The md Dictionary 9 PostScript Interpreter Graphics State Management 9 Page Setup and Print Dialogs 10 4 Compatibility Issues 11 Determining the Identity of the Driver 12 Use of LaserPrep procedures 12 Flushing the QuickDraw Graphics State into a QuickDraw Picture 13 PostScript Language PicComments 14 Emitting Device Setup Code 17 EPS File Generation and Import 18 Emitting Binary Data 21 5New PrGeneral Calls 22 Obtaining the PPD File for the Target Printer 23 Obtaining Information about the Target Printer 24 6 References 28 General References 28 PostScript Language References 29 Index 31 iii iv Contents (2 Apr 93) Tips for Working with the New PostScript Printer Driver for Macintosh 1 Introduction Adobe Systems Incorporated and Apple Computer have jointly developed a new PostScript™ printer driver for Macintosh®. This driver, referred to here as PSPrinter, is a replacement for the existing Apple® LaserWriter® driver. PSPrinter is not a modified LaserWriter driver but is a complete rewrite. The architecture and code generation strategy of PSPrinter is significantly differ- ent than the existing LaserWriter driver and allows for the generated Post- Script language code to be more efficient and to conform to conventions for structured PostScript language code. This technical note is intended to alert application writers to the differences between the PSPrinter driver and the existing Apple LaserWriter driver (referred to here as the ‘old LaserWriter driver’, meaning all LaserWriter drivers prior to version 8.0) from the viewpoint of application writers. It highlights areas where compatibility issues exist and how developers can avoid compatibility problems. Most of the compatibility problems are due to techniques, used by application developers, which have long been discour- aged by Apple. Other areas are more subtle, and application writers may not be aware of their dependencies on the old Apple LaserWriter driver architec- ture. 1.1 Who Should Read This Document Most of this document is intended to aid application developers who generate their own custom PostScript language code via one of several mechanisms available to Macintosh applications. Typically these are the application devel- opers who either knowingly or unknowingly take advantage of the structure and operation of the old LaserWriter driver. This document tries to address some of the architectural differences between PSPrinter and the old Laser- Writer driver and how these differences may impact the PostScript language code an application emits. Section 2 discusses some of the design objectives of the new driver. Section 3 gives a brief overview of the architecture of the driver, laying the groundwork for discussion of areas where application writers might encounter differences 5 between PSPrinter and the old LaserWriter driver. Section 4 goes into depth on specific compatibility issues which have been identified and discusses ideas for avoiding these compatibility problems. Section 5 discusses new PrGeneral selectors and how they may be used to allow applications to gather more information about the current print job and target printer. Finally section 6 gives a list of references which may be useful to Macintosh applica- tion writers, both those who generate custom PostScript language code during printing and those who allow the driver to generate all the PostScript language code. Application writers who allow the driver to generate all the PostScript lan- guage code during the printing process should read the following: •section 3.4 discussing the page setup and print dialogs •section 4.6 discussing EPS file generation • the relevant documents listed in section 6 which discuss aspects of print- ing and print driver compatibility which are not necessarily specific to printing through PSPrinter or the old LaserWriter driver. Writers of applications who generate any custom PostScript language code while printing with the old LaserWriter driver are encouraged to carefully read this complete document, especially section 4. 2New Driver Overview The new driver completely replaces the old LaserWriter driver. The principal design goals of the new driver were: •To make full use of the new capabilities available in PostScript Level 2 software (such as data compression, improved pattern rendering, rectangle drawing primitives, and device-independent color calibration) while main- taining compatibility with older, Level 1 output devices •To improve performance when printing to all PostScript printers •To provide user access to all device-specific features of any chosen output device through a dynamically extensible user interface •To allow for future expansion and adaptation through a modular architec- ture for network communications •To improve flexibility and compatibility by allowing PostScript language files to be saved in a variety of portable formats, including Encapsulated PostScript language file format (EPS). 6 Tips for Working with the New PostScript Printer Driver for Macintosh (2 Apr 93) •To generate output files conforming to Adobe’s document structuring con- ventions (DSC). While some of the improvements available with PSPrinter may not be obvi- ous at the user interface level of the driver, such as improved performance and PostScript Level 2 software support, there are several improvements which provide new functionality to end users. The ability to handle 2-up and 4-up printing (see Figure 1) is a direct result of PSPrinter’s generation of con- forming PostScript language code. The ability to allow for extended paper sizes and paper bin support (see Figure 2) is due to the driver’s use of Post- Script Printer Description (PPD) files for configuring the user interface and generating device specific code. The ability to generate EPS files (see Figure 3) is available, again because of PSPrinter’s generation of conforming Post- Script language code. Figure 1 Page Setup Dialog Figure 2 Print Dialog 2 New Driver Overview 7 Figure 3 Print to Disk Dialog 3 Driver Architecture This section includes a short summary of the PSPrinter architecture. This dis- cussion describes the way the new driver functions. This is necessary in order to discuss the application compatibility issues described in section 4. 3.1 2 Pass design PSPrinter is by design a 2-pass driver. In order to optimize the generated PostScript language code, it first spools the application drawing to disk as a sequence of QuickDraw™ pictures, one for each page. When the application calls PrCloseDoc the driver completes writing the spool file to disk. The set- ting of foreground printing or background printing controls when the second pass is completed. If Background printing is Off, then the application’s call to PrCloseDoc causes PSPrinter to perform the second pass of printing before PrCloseDoc returns. PSPrinter opens the connection to the printer, performs queries for fonts and other information, calls DrawPicture on each picture in the spool file, and converts the resulting QuickDraw calls to PostScript lan- guage code. When all the pages have been sent to the printer, PSPrinter closes

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    32 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us