Force papersize to A4

Helge Blischke h.blischke at
Fri Apr 15 05:37:33 PDT 2005

Daniel Lawson wrote:
> Hi,
> I have a site of about 50 win98/winXP computers on a SAMBA domain, using CUPS to print.  We've got 5 or so printers set up, and most of them work fine.
> For one of them however, the default print size on the clients keeps getting reset back to Letter. It's possible there is some weird policy foo happening which causes this, but it's near to impossible to track down - I've been round every machine and set the print size to A4, and it still happens.
> When people print to this particular printer (which is the default queue), in Letter, it gets stopped by the printer, which errors and prompts to carry on anyway. No one seems brave enough to hit 'ok', so it effectively jams the queue for most of the day.
> What I'm asking is: is there any existing method to force papersize from Letter to A4?. I'm willing to accept that there might be some formatting issues or even lost data, but when people start complaining about that I can fix their profiles in turn.
> I'm not above coding this myself, but I'd need some tips as to how to implement such a filter.
> The printers are all PS / PCL variants (HP 4550CN, HP LJ III-si, Mita v300 PCL5e, Kyocera Mita KM-5035B, Kyocera Mita FS-C5016N)
> Thanks!

Yes, there is a solution, suing the JobPatchFile keyword in the PPD. You
could modify 
this printer's PPD by inserting the following snippet near the global
(e.g. after the TTRasterizer stuff):
*JobPatchFile 1: "
% force A4 media size
/_sys_setppagedevice /setpagedevice load def
  dup /Pagesize known
  {dup /Pagesize [595 842] put}if
}bind def"
And don't forget to configure the printer to default A4 in CUPS.

This does *NOT* work with raw printing, though.


Helge Blischke
SRZ Berlin | Firmengruppe besscom

More information about the cups mailing list