Force papersize to A4

Helge Blischke h.blischke at srz.de
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
properties
(e.g. after the TTRasterizer stuff):
---snip---
*JobPatchFile 1: "
% force A4 media size
/_sys_setppagedevice /setpagedevice load def
/setpagedevice
{
  dup /Pagesize known
  {dup /Pagesize [595 842] put}if
  _sys_setpagedevice
}bind def"
*End
---snip---
And don't forget to configure the printer to default A4 in CUPS.

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

Helge


-- 
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom
http://www.srz.de




More information about the cups mailing list