Mac OS X pstopdf utility defaults to Letter page size

pdfpostscriptterminal

I am using the a2ps utility from Homebrew to pretty print code, generating .ps files, and then the Mac OS X utility pstopdf (used by Preview.app) to convert these to .pdf format. But whatever page size is specified in the PostScript, the generated PDF files have a Letter page size of 11 x 8.5 inches.

For example

a2ps --medium=A4 -P file myfile.py

or

a2ps --medium=A3 -P file myfile.py

generate PostScript files with the correct page dimensions (A4 and A3 respectively) but when converted to PDF by pstopdf the resulting PDF is Letter size with the output truncated at the right/ bottom edge of the page.

I can't find any mention anywhere of how to specify what default page size pstopdf uses. Opening the PostScript files in Preview.app uses pstopdf in the back end so I get the same result.

Best Answer

If I remove all page size information from a PostScript file, then Preview renders it on a Letter page, even though my default Paper size in CUPS is A4.

There are no user-accessible options or preferences that I can discern. It's certainly undocumented, if it exists.

You may be better off trying to explicitly define the page size in a2ps.

Alternative PDF creators, like GhostScript, offer greater control over the output.