tags:

views:

409

answers:

2

I would like to add custom page sizes to my printer's .ppd (PostScript printer definition) file. What do I have to add to get a new page size working properly?

A: 

I have a Samsung printer so I downloaded the source code to the SpliX drivers. The driver source includes a Makefile to compile .ppd from sources that list the available page sizes much more succinctly. Now that missing paper size shows up in the print dialog's options.

(That did not solve my problem printing onto small paper. My real problem with custom paper sizes likely has something to do with the way applications talk to cups and the switch from .ps to .pdf as the preferred page input to cups in Ubuntu 9.04...)

joeforker
+2  A: 

You have to add values for each additional page size at 4 different places:

  1. for PageSize,
  2. for PageRegion,
  3. for ImageableArea and
  4. 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:

  1. Add your new lines at each of the 4 places in the PPD.
  2. Make sure you use uniq names for your new media sizes.
  3. Make sure you don't have any syntax errors in your PPD.
  4. 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).
pipitas