rrthomas / pdfjam

The pdfjam package for manipulating PDF files
GNU General Public License v2.0
378 stars 28 forks source link

Default paper size may not be needed? #4

Closed DavidFirth closed 5 years ago

DavidFirth commented 5 years ago

Jonathan (by email, see below) suggests to use locale to determine default paper size, rather than assuming A4. This seems a good idea, but I have no idea how robust or portable it would be. I would welcome any comments.

I have made it easy anyway with pdfjam to specify the default paper size (via pdfjam.conf), and to change the size on the fly. So this does not seem to be high priority work, for me anyway.


Date: Mon, 16 Nov 2015 17:40:46 -0500 From: Jonathan To: "Firth, David" Subject: Re: pdfjam default paper size from locale?

On Linux, at least, "locale -k LC_PAPER" will tell you the width and height (in millimeters) of the locale's default paper size. For me:

$ locale -k LC_PAPER height=279 width=216 paper-codeset="UTF-8" $ dc

In comparison, for Brits:

$ LC_ALL=en_GB.utf-8 locale -k LC_PAPER height=297 width=210 paper-codeset="UTF-8" $

You could try that (if the user hasn't explicitly set the paper size) and fall back on A4 if it doesn't work.


DavidFirth commented 5 years ago

Now implemented for version 3.00.