[cups.bugs] [MOD] STR #2941: PPD generator (ppdc/drv) is missing directive to set the code of the "*CustomPageSize True: ..." line in the PPD file

Till Kamppeter till.kamppeter at gmail.com
Wed Sep 10 02:42:26 PDT 2008


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

[ I have assigned this bug report to the CUPS DDK. If the CUPS DDK is 
  EOL/discontinued due to the DDK being murged into CUPS 1.4.x, please
  reassign the report appropriately. ]

See last comments of the following HPLIP bug report:

https://bugs.launchpad.net/ubuntu/+source/cupsddk/+bug/264727

On HP's attempt to generate a PPD file containing the following lines

*HWMargins: 18 36 18 9
*VariablePaperSize: True
*MaxMediaWidth: 612.00
*MaxMediaHeight: 3168.00
*NonUIOrderDependency: 105 AnySetup *CustomPageSize
*CustomPageSize True: "pop pop pop pop pop
%% Option Setting: PageSize=Custom"
*End
*ParamCustomPageSize Width: 1 points 72.00 612.00
*ParamCustomPageSize Height: 2 points 288.00 3168.00
*ParamCustomPageSize Orientation: 3 int 0 0
*ParamCustomPageSize WidthOffset: 4 points 0 0
*ParamCustomPageSize HeightOffset: 5 points 0 0

with something like

  HWMargins 18 36 18 9
  VariablePaperSize yes
  MinSize 72.00 288.00
  MaxSize 612.00 3168.00
  CustomSizeCode "pop pop pop pop pop
%% Option Setting: PageSize=Custom"

(the directive in the last line does not exist actually, but I will talk
about this below)

in the .drv file, we ran into the problem that there is no directive for
the .drv file to set the code content of the "*CustomPageSize True: ..."
line in the PPD file. This forces the line always to come out as

 *CustomPageSize True: "pop pop pop <</PageSize[5 -2 roll]/ImagingBBox
null>>setpagedevice"

which prevents the CUPS DDK from being able to add custom paper size
support to the PPDs for arbitrary drivers. Especially for drivers which
can take PDF as input data correct PPDs cannot be generated.

Having such a directive was probably foreseen as one can see in the CUPS
DDK 1.2.3 source code, file ppdc/ppdc-driver.cxx, function
ppdcDriver::write_ppd_file(), lines 862-874. Looking deeper into the
source code I have found that the method to populate the variable
custom_size_code, ppdcDriver::set_custom_size_code() is never called in
the whole source code of CUPS DDK.

The fix is simple. The attached patch introduces the directive
"CustomSizeCode" for the .drv files and so the above-mentioned .drv file
lines actually create the desired lines in the PPD file.

Note that for consistency of CUPS DDK besides this patch also code needs
to be introduced to read out the code of the "*CustomPageSize True: ..."
of PPD files and to add the "CustomSizeCode" directive into a generated
..drv file if needed.

Link: http://www.cups.org/str.php?L2941
Version: 1.4-current
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CustomSizeCode.patch
URL: <https://lists.cups.org/pipermail/cups/attachments/20080910/74a573e3/attachment.ksh>


More information about the cups mailing list