What's the easiest way to add custom page sizes to a .ppd?
You have to add values for each additional page size at 4 different places:
- for
PageSize
, - for
PageRegion
, - for
ImageableArea
and - for
PaperDimension
Best, you take one PPD and search for sections enclosed in these keywords
*OpenUI *PaperSize: PickOne
....
*CloseUI *PaperSize
.
*OpenUI *PageSize: PickOne
....
*CloseUI *PageSize
and for the sections starting with
*DefaultImageableArea: ...
.
*DefaultPaperDimension: ...
Use the lines you find in there as templates for your new entries. Note, that dimensions are given in PostScript points (where 72pt == 1inch ~= 2.54cm).
Caveats:
- Add your new lines at each of the 4 places in the PPD.
- Make sure you use uniq names for your new media sizes.
- Make sure you don't have any syntax errors in your PPD.
- Once you're done (or while you're at editing it), check your PPD with the
cupstestppd
utility (available on Linux and on Mac OS X).
Update
Regarding testing the PPD with cupstestppd
:
By default, this will report errors as **FAIL**
even if it finds some "not-so-important" syntax issues (PPD string translations, filters, UIConstraints, profiles, media sizes). You can relax these strict checks a bit and use -W all
in order to report all these as warnings only, not as errors:
cupstestppd -W all /path/to/PPDfile.ppd
If this returns lines saying WARN size ...
you should pay close attention to them and make sure you fix the PPD.