From: Sandra Wittenbrock Subject: cups: Fwd: Re: Problem printing postscript file Date: Fri, 14 Feb 2003 09:14:32 -0800 User-Agent: KMail/1.4.3 To: cups@lbl.gov MIME-Version: 1.0 Message-Id: <200302140914.32589.swittenbrock@lbl.gov> Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mgelbaumpc.lbl.gov id h1EHBr208297 Here is some information from Micheal Sweet, on how to fix possible postscript printing problems. ---------- Forwarded Message ---------- Subject: Re: Problem printing postscript file Date: Tue, 11 Feb 2003 14:41:49 -0500 From: Michael Sweet To: Sandra Wittenbrock Sandra Wittenbrock wrote: > Hello, > > I spoke with Tammy about this problem this morning. Using PP 4.2.2 > the attached postscript file prints correctly. When printing using > PP 4.3 the scale is wrong, and a small portion of the plot is blown > up and printed. The same problem has occured on every printer we > have tried it on; four different printers. The printer > configurations for PP 4.2.2 and PP 4.3 are identical. I've looked at the PostScript file in question, and believe I have an answer for you... ESP Print Pro 4.3 contains numerous changes to the PostScript filter, some of which require that the PostScript files that identify themselves as compliant with the Adobe Document Structuring Conventions (the "PS-Adobe" text in the first line...) actually conform to the spec. We made this change because many of our customers were complaining of problems with the filter behavior in 4.2.x... The file you have provided does not conform to the Adobe Document Structuring Conventions. First 8 lines of said file (http://www.lbl.gov/IT/CIS/dp/samples/grafpak.ps): %!PS-Adobe-2.0 %%Creator: GRAFPAK-GKS POSTSCRIPT Driver WSM version $Revision: 1.3 $ %%Title: GKS POSTSCRIPT Output %%Pages: (atend) %%DocumentFonts: (atend) %%BoundingBox: 0 0 576 776 %%EndComments save A simple short-term fix is to change the first line to read: %! That is, strip the "PS-Adobe-2.0" portion of the first line. You can also just prefix a line with "%!" to the beginning of the file to achieve the same result. A script for printing using this would look like: #!/bin/sh (echo '%!'; cat $1) | lp -d printer The problems with the file are as follows: 1. The file is missing a %%BeginProlog line after the %%EndComments line. 2. The file uses page comments of the form "%%Page: 0", "%%Page: 1", etc. The correct format is "%%Page: text number", where "text" is a document page number for display to the user and "number" is the ordinal page number starting at 1 and increasing for each page. 3. The last "%%Page: 2" comment is invalid. 4. The page data is not independent of the other pages. A save/restore is done between pages to save the graphics state before and after a showpage. 5. PostScript code between the %%EndProlog and first %%Page: comments should be enclosed within %%BeginSetup and %%EndSetup comments. 6. There is no %%EOF comment at the end of the file. The fixes for the original application that generated the PostScript should not be extensive. -- ______________________________________________________________________ Michael Sweet, Easy Software Products mike at easysw dot com Printing Software for UNIX http://www.easysw.com ------------------------------------------------------- -- Sandra Wittenbrock LBNL x4860