[pdftex] RE: pdf to postscript (pdf2ps command)

Kester Clegg kester at cs.york.ac.uk
Sun Jun 1 17:13:37 CEST 2003

John Culleton <john at wexfordpress.com> writes:

> Ghostscript in combination with the above script will take a pdf file
> and convert it to ps. the command is simple:
> pdf2ps foo.pdf.

hmmm, check your version though.  I've had problems with that particular
tool producing ps that barfs on some printers.  For those interested
here is what our technical support discovered:
>The commands were:
>pdf2ps test.pdf
>psbook test.ps | psnup -2l > testbook.ps
>lp -d pp12 -D -T testbook.ps

Printers pp12 *and* pp10 give the error you saw (`typecheck' for
the first use of `where') with the original file. The previewers
should give this error, too. A PostScript debugger I have also
gives the error.

Your problem is a known bug in ps2pdf (actually gs) which
has been there since 6.51 and is still in 7.04. I've stuck with
GNU gs 6.51 since using it to replace the buggy 5.10 and 5.50,
and not moved on because of the bugs I found in Aladdin 7.0.
GNU are now at 7.05, and Aladdin at 7.20. I'll probably try
GNU gs 7.05 sometime. The problem is that ps2pdf (gs) generates
the command `596 842 null setpagesize' for each page of your
document because of a rounding error. It should read
`595 842 /a4 setpage'. The `null' is given as an argument to
the `where' command.

You can fix the problem by running the following command on
the original (pdf2ps-generated) PostScript file:

overwrite test.ps sed 's:null setpagesize:/a4 setpagesize:' < test.ps

and then repeating the `psbook ... lp' command.


More information about the pdftex mailing list