Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Page parameters in PS to PDF conversion

15 views
Skip to first unread message

Bill Donahue

unread,
Jul 21, 2021, 12:50:49 PM7/21/21
to
I am preparing a reprint of a book I laid out in TeX (plain, with ZZTeX macros) 20 years ago.

At that time, the book printers worked directly with PS files. I don't know whether PDF conversion was an option then, but we didn't use it. But I now need to output a PDF from the PS files to submit to the printer.

The layout in TeX had a 7 x 10 page size. However, when I use Distiller (version 21.005.20058) to generate a PDF from the PS, I get 8.5 x 11. Looking at the PS file, I find:
/PageHeight 792 def /PageWidth 612 def
on line 166. Evidently, the page is set at 8.5 x 11.

I have tried changing the dimensions here to:
/PageHeight 720 def /PageWidth 504 def
However, the output PDF still has a page size of 8.5 x 11. All that has happened is that the printed area has shifted downwards by 1 inch. The offset from the left edge of the page is the same.

I really don't want to try to run the original TeX files on our current system. Too much has changed, and there is too much chance for hard-to-find errors to sneak in.

So my question is, Is there a reasonable way to edit the PS file to get the original page parameters in the PDF?

Bill Donahue
Green Lion Press

Peter Flynn

unread,
Jul 21, 2021, 3:42:19 PM7/21/21
to
On 21/07/2021 17:50, Bill Donahue wrote:
[...]
> So my question is, Is there a reasonable way to edit the PS file to
> get the original page parameters in the PDF?

Have you tried the ps2pdf utility? I wouldn't edit the PS file except as
a last resort; I'd try the various Ghostscript parameters for the page size.

Peter

Bill Donahue

unread,
Jul 21, 2021, 6:18:57 PM7/21/21
to
Peter--

Thank you for pointing me in what I hope will be a good direction. I too would much rather not mess with the PS code.

I'm sure I have invisibly invoked both ps2pdf and GhostScript from TexShop, but never directly. I know they are on our Mac. Will see what I can do with them.

Bill


Bill Donahue

unread,
Jul 21, 2021, 8:19:45 PM7/21/21
to
After a few hours struggling with ps2pdf and GhostScript, I am at an impasse. Here's an example (from Terminal):

bill@Phaedra-2 / % ps2pdf -h
Usage: ps2pdfwr [options...] (input.[e]ps|-) [output.pdf|-]
bill@Phaedra-2 / % ps2pdfwr op1.ps op1.pdf
GPL Ghostscript 9.50: **** Could not open the file op1.pdf .
**** Unable to open the initial device, quitting.

Not surprising, since I didn't enter the path to op1.ps. Next attempt:

bill@Phaedra-2 / % ps2pdfwr 'users//shared/docs/optics/optics 2020/optics 2020 tex files/ps files/op1.ps'
GPL Ghostscript 9.50: **** Could not open the file op1.pdf .
**** Unable to open the initial device, quitting.

I messed around with GhostScript itself, but all I could get it to do was to list the bounding boxes of the pages. At least it could find the file!

Please, if all this is too elementary, just say so and I will figure it out myself one way or another.

Bill

Holger Schieferdecker

unread,
Jul 22, 2021, 3:20:20 AM7/22/21
to
Am 22.07.2021 um 02:19 schrieb Bill Donahue:
> On Wednesday, July 21, 2021 at 4:18:57 PM UTC-6, Bill Donahue wrote:
>> On Wednesday, July 21, 2021 at 1:42:19 PM UTC-6, peter wrote:
>>> On 21/07/2021 17:50, Bill Donahue wrote:
>>> [...]
>>>> So my question is, Is there a reasonable way to edit the PS file to
>>>> get the original page parameters in the PDF?
>>> Have you tried the ps2pdf utility? I wouldn't edit the PS file except as
>>> a last resort; I'd try the various Ghostscript parameters for the page size.
>>>
>>> Peter
>> Peter--
>>
>> Thank you for pointing me in what I hope will be a good direction. I too would much rather not mess with the PS code.
>>
>> I'm sure I have invisibly invoked both ps2pdf and GhostScript from TexShop, but never directly. I know they are on our Mac. Will see what I can do with them.
>>
>> Bill
>
> After a few hours struggling with ps2pdf and GhostScript, I am at an impasse. Here's an example (from Terminal):
>
> bill@Phaedra-2 / % ps2pdf -h
> Usage: ps2pdfwr [options...] (input.[e]ps|-) [output.pdf|-]
> bill@Phaedra-2 / % ps2pdfwr op1.ps op1.pdf
> GPL Ghostscript 9.50: **** Could not open the file op1.pdf .
> **** Unable to open the initial device, quitting.

I don't have experience with a Mac, just a little bit with Linux. But
when I look at the prompt "bill@Phaedra-2 / %" I have the impression
that maybe you are in the root directory. Ghostscript complains that it
could not open the target file, maybe you don't have write permissions
there.

Try to got to the directory where your input file is located and make
sure you have write permissions there. If not copy the PS file to your
home directory and try it there.

You also could pass a path not only to the input file but to the output
file as well.

Hope that helps,
Holger

Bill Donahue

unread,
Jul 22, 2021, 4:50:29 PM7/22/21
to
Thank you, Holger. I will try it and let you know the result.

Bill

Bill Donahue

unread,
Jul 22, 2021, 6:58:30 PM7/22/21
to
Peter, Holger, and all--

The simplest (read "easiest for simpletons") solution is to run the PS files through Distiller and crop the pages of the PDF to 7" x 10" in Acrobat. A single crop setting for the four sides, applied globally, seems to get all the margins right.

Thank you for your help!

Bill

Peter Flynn

unread,
Jul 23, 2021, 10:05:03 AM7/23/21
to
On 22/07/2021 01:19, Bill Donahue wrote:
> On Wednesday, July 21, 2021 at 4:18:57 PM UTC-6, Bill Donahue wrote:
> After a few hours struggling with ps2pdf and GhostScript, I am at an impasse. Here's an example (from Terminal):
>
> bill@Phaedra-2 / % ps2pdf -h
> Usage: ps2pdfwr [options...] (input.[e]ps|-) [output.pdf|-]
> bill@Phaedra-2 / % ps2pdfwr op1.ps op1.pdf
> GPL Ghostscript 9.50: **** Could not open the file op1.pdf .
> **** Unable to open the initial device, quitting.
>
> Not surprising, since I didn't enter the path to op1.ps. Next attempt:
>
> bill@Phaedra-2 / % ps2pdfwr 'users//shared/docs/optics/optics 2020/optics 2020 tex files/ps files/op1.ps'
> GPL Ghostscript 9.50: **** Could not open the file op1.pdf .
> **** Unable to open the initial device, quitting.

My strong advice is never to use filenames or folder names with spaces
in them.
They make you go grey, give you a splitting headache, delay the trains,
curdle the milk, and cause nuclear wars :-)
Yes, I know single quotes will shield the name. I still don't put spaces
in folder names or file names.

In fact, if you're in your login directory, shouldn't that be /Users ?

Better still cd to the directory and just use op1.ps

0 new messages