这是indexloc提供的服务,不要输入任何密码
Skip to content

ippeveprinter and pagesize tolerance #487

@jubork

Description

@jubork

ippeveprinter (2.4.2) does not allow for any pagesize tolerance.
I'm not sure whether IPP standard allows for any.
The relevant code is (ippeveprinter.c:8779)

      for (i = 0; i < count ; i ++)
      {
        size  = ippGetCollection(supported, i);
        x_dim = ippFindAttribute(size, "x-dimension", IPP_TAG_ZERO);
        y_dim = ippFindAttribute(size, "y-dimension", IPP_TAG_ZERO);

        if (ippContainsInteger(x_dim, x_value) && ippContainsInteger(y_dim, y_value))
          break;
      }

The problem comes from the fact that IPP specifies page size in 0.01mm units,
while PPDs usually in integer postscript points (1/72 inch). The conversion between the two
may introduce small offset, and a print job submitted to ippeveprinter may
be rejected during verify phase.

The quick&dirty (very little testing done) patch below implements
more robust conversion algorithm, which seems to work for me
for a couple of printers/PPDs.

cups-2.4.2-pspoints.patch.txt

However, I think better approach would be to allow for some page size tolerance,
i.e. via command line option. The default could be zero for compatibility.

On a side note, the patch also improves handling of IPP_TAG_ENUM options.
Without it, conversion of enums to integer gives often zero (again very little
testing done).

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions