Celeb Glow
general | March 20, 2026

ps2pdf does not honour Pagesize directive

Postscript 3.0 file requires A3 size:

~/home_shared/project/auto/2020$ head -1 electr.ps
%!PS-Adobe-3.0
~/home_shared/project/auto/2020$ grep -i bound electr.ps
%%PageBoundingBox: 0 0 842 1191 % A3 papierformaat

Still the resulting pdf is for "letter" paper size which is the last thing I want, being in Europe.

~/home_shared/project/auto/2020$ ps2pdf -sPapersize=A3 electr.ps
~/home_shared/project/auto/2020$ pdfinfo electr.pdf
Producer: GPL Ghostscript 9.26
CreationDate: Tue Mar 31 11:57:12 2020 GMT
ModDate: Tue Mar 31 11:57:12 2020 GMT
Tagged: no
UserProperties: no
Suspects: no
Form: none
JavaScript: no
Pages: 2
Encrypted: no
Page size: 612 x 792 pts (letter)
Page rot: 0
File size: 2848 bytes
Optimized: no
PDF version: 1.4

Is this a bug, or is there something I missed or misunderstood? This is on Ubuntu 18.04 LTS, religiously patched to most recent state.

2

1 Answer

The lines you've highlihgted are comments (PostScript comments begin with '%'). In general a conforiming PostScritp itnerpreter will ignore comment lines altogether.

So its not that ps2pdf is failing to 'honour the PageSize directive' the problem is much more likely to be that the input file does not contain a setpagedevice request to alter the media size.

In that case you will get the default media size whcih for Ghostscript is usually either Letter or A4 depending on how the binary was built, and the the presence or absence of some extra utilities like libpaper (and whether the binary was built to use these).

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy