Comment 3 for bug 1201935

Revision history for this message
Sanjay Kumar (sanjay-kumar14) wrote :

Steps to add custom paper size in hpcups ppd.
1) Install latest HPLIP release if current HPLIP release does not contain support for the given printer.

2) Open /usr/share/hplip/data/models/models.dat and search for Printer model name section for which you need to add custom paper size.

3) Note down the 'tech-class' and 'tech-subclass' values.
    e.g for HP Officejet 7110 Wide format printer tech-class=Saipan and tech-subclass=Advanced

4) Open /usr/share/cups/drv/hpcups.drv file in root mode for editing.

5) Search 'tech-class:tech:subclass' section in the hpcups.drv file.
   e.g for HP Officejet 7110 Wide format printer, search for 'Saipan:Advanced' string.

6) Just above the searched string add custom paper size.

  Generic syntax (All values are in postscript points, 1 inch = 72 postscript points):

  CustomMedia "CUSTOM_PAPER1/CUSTOM_PAPER2" WIDTH HEIGHT LeftMargin BottomMargin RightMargin TopMargin "<</cupsInteger0 PCL_ID/PageSize [WIDTH HEIGHT]/ImagingBBox null>>setpagedevice" "<</cupsInteger0 PCL_ID/PageSize[WIDTH HEIGHT]/ImagingBBox null>>setpagedevice"

  Where:
  CUSTOM_PAPER1 = Any Unique name of the paper size used internally for constraint checking etc.
  CUSTOM_PAPER2 = Display Name of the paper size, which will be seen by the user in print dialog.
  WIDTH HEIGHT : All in postscript points
  LeftMargin BottomMargin RightMargin TopMargin: For best results use margins of the nearst statdard paper size.
  PCL_ID : 101 (Always 101 for hpcups ppds)
    e.g
  CustomMedia "CUSTOM_6x7in/CUSTOM 6x7in" 432 504 14 14 14 14 "<</cupsInteger0 101/PageSize [432 504]/ImagingBBox null>>setpagedevice" "<</cupsInteger0 101/PageSize[432 504]/ImagingBBox null>>setpagedevice"

7) Save the file and remove previously added print queue (if any) and restart cups.

8) Add new print queue.

9) New ppd file will be now generated from the hpcups.drv file and newly created paper size will be seen in print dialog.