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?
4 Answers
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 unique 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.

- 27,591
- 48
- 66
- 103

- 86,724
- 23
- 248
- 345
-
7FYI 1 inch is *exactly* 2.54cm – dreamlax Aug 27 '12 at 02:24
-
@kurt Thanks, your tutorial helped me to fix a paper size bug in Dai Nippon DN80 driver. If anybody has the same problem on Dai Nippon DN80, ask me. – Kurt UXD Nov 10 '12 at 05:57
-
I wonder, where do the printers get the paper definitions, where can i submit a new size? – Ark74 Feb 22 '16 at 23:20
-
@Ark74: I don't understand your question. The printer (as a physical device) has its supported paper sizes built-in through its mechanical engineering. The print queue has the supported paper sizes defined by the statements in the PPD (as described above). Nothing prevents you from writing "false" statements into the PPD. But do not be astonished if your physical device will not obey your wrong statements.... – Kurt Pfeifle Feb 22 '16 at 23:38
-
1@KurtPfeifle yeah i get it. I mean the software part, i assume CUPS has the standar paper sizes already build in, so any release we'll find them. My question is, are they preset by cups, postscript, ghostscript? If i would like to submit one, where would i submit that size, Paper Size Oficio Mexico, (216mmx340mm) it's been years with no support. Maybe i could request for inclusion. Thanks. – Ark74 Feb 24 '16 at 02:26
-
2@Ark74: Look up in ***[IANA's IPP Registrations Database](http://www.iana.org/assignments/ipp-registrations/ipp-registrations.xml)*** if that paper size is already "known" (maybe under a different name). If not, ask on the *[CUPS developers mailing list](https://www.cups.org/mailman/listinfo/cups-devel)* what you could do to get it supported. – Kurt Pfeifle Feb 24 '16 at 05:20
-
Thanks, i'll sort the rest out :) – Ark74 Feb 25 '16 at 14:11
I have HP LaserJet 1200. The PPD file provided by the Foomatic/pxlmono driver lacks some standard paper sizes. I updated it with the following statements:
*OpenUI *PageSize/Page Size: PickOne
*FoomaticRIPOption PageSize: enum CmdLine A
*OrderDependency: 100 AnySetup *PageSize
*DefaultPageSize: A4
*PageSize Letter/US Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
*FoomaticRIPOptionSetting PageSize=Letter: " -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=792"
*End
*PageSize Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
*FoomaticRIPOptionSetting PageSize=Executive: " -dDEVICEWIDTHPOINTS=522 -dDEVICEHEIGHTPOINTS=756"
*End
*PageSize Legal/US Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
*FoomaticRIPOptionSetting PageSize=Legal: " -dDEVICEWIDTHPOINTS=612 -dDEVICEHEIGHTPOINTS=1008"
*End
*PageSize A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
*FoomaticRIPOptionSetting PageSize=A4: " -dDEVICEWIDTHPOINTS=595 -dDEVICEHEIGHTPOINTS=842"
*End
*PageSize A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
*FoomaticRIPOptionSetting PageSize=A5: " -dDEVICEWIDTHPOINTS=420 -dDEVICEHEIGHTPOINTS=595"
*End
*PageSize A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
*FoomaticRIPOptionSetting PageSize=A6: " -dDEVICEWIDTHPOINTS=298 -dDEVICEHEIGHTPOINTS=420"
*End
*PageSize A7/A7: "%% FoomaticRIPOptionSetting: PageSize=A7"
*FoomaticRIPOptionSetting PageSize=A7: " -dDEVICEWIDTHPOINTS=210 -dDEVICEHEIGHTPOINTS=298"
*End
*PageSize EnvISOB5/Envelope B5: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB5"
*FoomaticRIPOptionSetting PageSize=EnvISOB5: " -dDEVICEWIDTHPOINTS=499 -dDEVICEHEIGHTPOINTS=709"
*End
*PageSize EnvISOB6/Envelope B6: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB6"
*FoomaticRIPOptionSetting PageSize=EnvISOB6: " -dDEVICEWIDTHPOINTS=354 -dDEVICEHEIGHTPOINTS=499"
*End
*PageSize EnvISOB7/Envelope B7: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB7"
*FoomaticRIPOptionSetting PageSize=EnvISOB7: " -dDEVICEWIDTHPOINTS=250 -dDEVICEHEIGHTPOINTS=354"
*End
*PageSize B5/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5"
*FoomaticRIPOptionSetting PageSize=B5: " -dDEVICEWIDTHPOINTS=516 -dDEVICEHEIGHTPOINTS=729"
*End
*PageSize B6/B6 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B6"
*FoomaticRIPOptionSetting PageSize=B6: " -dDEVICEWIDTHPOINTS=363 -dDEVICEHEIGHTPOINTS=516"
*End
*PageSize B7/B7 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B7"
*FoomaticRIPOptionSetting PageSize=B7: " -dDEVICEWIDTHPOINTS=258 -dDEVICEHEIGHTPOINTS=363"
*End
*PageSize Env10/Envelope #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
*FoomaticRIPOptionSetting PageSize=Env10: " -dDEVICEWIDTHPOINTS=297 -dDEVICEHEIGHTPOINTS=684"
*End
*PageSize EnvDL/Envelope DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
*FoomaticRIPOptionSetting PageSize=EnvDL: " -dDEVICEWIDTHPOINTS=312 -dDEVICEHEIGHTPOINTS=624"
*End
*PageSize EnvMonarch/Envelope Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
*FoomaticRIPOptionSetting PageSize=EnvMonarch: " -dDEVICEWIDTHPOINTS=279 -dDEVICEHEIGHTPOINTS=540"
*End
*PageSize EnvC5/Envelope C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
*FoomaticRIPOptionSetting PageSize=EnvC5: " -dDEVICEWIDTHPOINTS=459 -dDEVICEHEIGHTPOINTS=649"
*End
*PageSize EnvC6/Envelope C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
*FoomaticRIPOptionSetting PageSize=EnvC6: " -dDEVICEWIDTHPOINTS=323 -dDEVICEHEIGHTPOINTS=459"
*End
*PageSize EnvC7/Envelope C7: "%% FoomaticRIPOptionSetting: PageSize=EnvC7"
*FoomaticRIPOptionSetting PageSize=EnvC7: " -dDEVICEWIDTHPOINTS=230 -dDEVICEHEIGHTPOINTS=323"
*End
*CloseUI: *PageSize
*OpenUI *PageRegion: PickOne
*OrderDependency: 100 AnySetup *PageRegion
*DefaultPageRegion: A4
*PageRegion Letter/US Letter: "%% FoomaticRIPOptionSetting: PageSize=Letter"
*PageRegion Executive/Executive: "%% FoomaticRIPOptionSetting: PageSize=Executive"
*PageRegion Legal/US Legal: "%% FoomaticRIPOptionSetting: PageSize=Legal"
*PageRegion A4/A4: "%% FoomaticRIPOptionSetting: PageSize=A4"
*PageRegion A5/A5: "%% FoomaticRIPOptionSetting: PageSize=A5"
*PageRegion A6/A6: "%% FoomaticRIPOptionSetting: PageSize=A6"
*PageRegion A7/A7: "%% FoomaticRIPOptionSetting: PageSize=A7"
*PageRegion EnvISOB5/Envelope B5: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB5"
*PageRegion EnvISOB6/Envelope B6: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB6"
*PageRegion EnvISOB7/Envelope B7: "%% FoomaticRIPOptionSetting: PageSize=EnvISOB7"
*PageRegion B5/B5 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B5"
*PageRegion B6/B6 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B6"
*PageRegion B7/B7 (JIS): "%% FoomaticRIPOptionSetting: PageSize=B7"
*PageRegion Env10/Envelope #10: "%% FoomaticRIPOptionSetting: PageSize=Env10"
*PageRegion EnvDL/Envelope DL: "%% FoomaticRIPOptionSetting: PageSize=EnvDL"
*PageRegion EnvMonarch/Envelope Monarch: "%% FoomaticRIPOptionSetting: PageSize=EnvMonarch"
*PageRegion EnvC5/Envelope C5: "%% FoomaticRIPOptionSetting: PageSize=EnvC5"
*PageRegion EnvC6/Envelope C6: "%% FoomaticRIPOptionSetting: PageSize=EnvC6"
*PageRegion EnvC7/Envelope C7: "%% FoomaticRIPOptionSetting: PageSize=EnvC7"
*CloseUI: *PageRegion
*DefaultPaperDimension: A4
*PaperDimension Letter/US Letter: "612 792"
*PaperDimension Executive/Executive: "522 756"
*PaperDimension Legal/US Legal: "612 1008"
*PaperDimension A4/A4: "595 842"
*PaperDimension A5/A5: "420 595"
*PaperDimension A6/A6: "298 420"
*PaperDimension A7/A7: "210 298"
*PaperDimension EnvISOB5/Envelope B5: "499 709"
*PaperDimension EnvISOB6/Envelope B6: "354 499"
*PaperDimension EnvISOB7/Envelope B7: "250 354"
*PaperDimension B5/B5 (JIS): "516 729"
*PaperDimension B6/B6 (JIS): "363 516"
*PaperDimension B7/B7 (JIS): "258 363"
*PaperDimension Env10/Envelope #10: "297 684"
*PaperDimension EnvDL/Envelope DL: "312 624"
*PaperDimension EnvMonarch/Envelope Monarch: "279 540"
*PaperDimension EnvC5/Envelope C5: "459 649"
*PaperDimension EnvC6/Envelope C6: "323 459"
*PaperDimension EnvC7/Envelope C7: "230 323"
*DefaultImageableArea: A4
*ImageableArea Letter/US Letter: "18 36 594 756"
*ImageableArea Executive/Executive: "18 36 504 720"
*ImageableArea Legal/US Legal: "18 36 594 972"
*ImageableArea A4/A4: "18 36 577 806"
*ImageableArea A5/A5: "18 36 402 559"
*ImageableArea A6/A6: "18 36 280 384"
*ImageableArea A7/A7: "18 36 192 262"
*ImageableArea EnvISOB5/Envelope B5: "18 36 481 673"
*ImageableArea EnvISOB6/Envelope B6: "18 36 336 463"
*ImageableArea EnvISOB7/Envelope B7: "18 36 232 318"
*ImageableArea B5/B5 (JIS): "18 36 498 693"
*ImageableArea B6/B6 (JIS): "18 36 345 480"
*ImageableArea B7/B7 (JIS): "18 36 240 327"
*ImageableArea Env10/Envelope #10: "18 36 279 648"
*ImageableArea EnvDL/Envelope DL: "18 36 294 588"
*ImageableArea EnvMonarch/Envelope Monarch: "18 36 261 504"
*ImageableArea EnvC5/Envelope C5: "18 36 441 613"
*ImageableArea EnvC6/Envelope C6: "18 36 305 423"
*ImageableArea EnvC7/Envelope C7: "18 36 212 287"

- 155
- 5
If you're trying to print outside of the standard document length, for instance printing onto a roll.
open terminal, or command shell, or optional windows bash prompt
cd ..
cd ..
cd etc
cd cups
cd ppd
install vim first or use nano(program file editors) (vim has a tutor just type vimtutor)
sudo vim Eastman_Kodak_Company_KODAK_ESP_3200_Series_AiO.ppd
scroll to the max height width and custom page params
i
to insert
ESC
to exit insert mode
:wq!
to save and exit file
Note the width paramater will be named or in order of width, height. The max width paramater should stay the same or it will throw the printers alignment off, but you can set the length to anything I believe. Then your printer will not create length boundaries in page setup and will allow you to print in continuous loop with no margin. Make sure your paper length is cut according to your page layout or it will simply spit out the rest of the roll. This was my first try at it and I accidentally changed the width paramaters which were 712 I believe.

- 121
- 1
- 6
-
This seems an exact duplicate of your [answer to a similar question](//unix.stackexchange.com/a/583526/112566) over on [unix.se]. You shouldn't duplicate such content (as the two copies will drift apart as they are edited). Instead, link one question to the other. – Toby Speight Aug 20 '22 at 09:36
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...)

- 40,459
- 37
- 151
- 246
-
The printer driver source code is a much easier place to edit the available page sizes compared to editing the (generated) ppds directly. – joeforker Aug 27 '12 at 13:02
-