Default Ghostscript paper size

The three times god-forsaken Ghostscript (I use the Debian package gs-afpl) suite is shipped worldwide with the US letter default paper size. So, when you use it (e.g. to convert PS to PDF), and if the source file does not specify a paper size, the output file will have a letter size, instead of the more sane A4.

You can specify A4 size at runtime, with the -sPAPERSIZE=a4 flag:

ps2pdf -sPAPERSIZE=a4 input.ps

However, if you want to always use A4 as default, you can change the gs_init.ps file (locate gs_init.ps), and uncomment the following line (remove the leading ‘%‘):

% /DEFAULTPAPERSIZE (a4) def

Beware that in Debian you will have to change it to (because the name of the variable is different):

/DEFPAPERSIZE (a4) def

You will only need to edit the gs_init.ps file (as root), make the changes and save the file. Subsequent gs uses (e.g. ps2pdf), will default to A4 page size.

2 Comments »

  1. Default Ghostscript paper size « handyfloss said,

    September 18, 2008 @ 14:46 pm

    […] Entry available at: http://handyfloss.net/2006.10/default-ghostscript-paper-size/ […]

  2. Madd said,

    June 2, 2011 @ 8:15 am

    you made my day!

    cheers

RSS feed for comments on this post · TrackBack URI

Leave a Comment