New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PPDs for driverless printing: Make jobs be printed in correct order for face-up/face-down #5345
Conversation
cups/ppd-cache.c
Outdated
/* Find out on which position of the list of output bins the default one is, if there | ||
is no default bin, take the first of this list */ | ||
i = 0; | ||
if ((attr = ippFindAttribute(response, "output-bin-supported", IPP_TAG_MIMETYPE)) != NULL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be IPP_TAG_ZERO to allow for IPP_TAG_KEYWORD or IPP_TAG_NAME values. But not IPP_TAG_MIMETYPE (which is the mimeMediaType syntax...)
cups/ppd-cache.c
Outdated
} | ||
} | ||
/* Look up the corresponding entry in the "printer-output-tray" attribute */ | ||
if ((attr = ippFindAttribute(response, "printer-output-tray", IPP_TAG_MIMETYPE)) != NULL && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
printer-output-tray is of type 1setOf octetString, so you want IPP_TAG_STRING here. And you'll need to use ippGetOctetString, copy it to a C string, and then look for the properties.
Till, I appreciate the pull request but the current changes have issues. See my comments... |
…d needed conversions.
I have fixed the two issues now. |
Hello,
|
@tudor2k3, please open a separate issue, as this one is only for OutputOrder as it does not do more than adding lines concerning the output order to the PPD. |
Is there still anything to be fixed on my pull request? |
Till, I haven't had a chance to review this fully, and since I am on a summer break at the moment it won't be happening anytime soon. Don't expect anything to happen until the end of August at the earliest. |
@tillkamppeter You are still using the non-portable strcasestr function... Since these values are case sensitive, it should just be a matter of changing to strstr. There are some other potential optimizations I'll look at doing as well... |
In #5315 and OpenPrinting/cups-filters#47 a user complained about that on printers which stack up their output pages face-up the pages should get printed in reverse order.
I have investigated this and the main problem is that many PPD files are missing the appropriate information about how the paper gets stacked.
In case of driverless printing the answers to the get-printer-attributes request always contains the needed information. Either the names of the output-bins (attributes "output-bin-supported", "output-bin-default" are named "face-up" or "face-down" or there is an array named "printer-output-tray" with the same number of items as "output-bin-supported", describing the properties of each output bin, especially telling about the way the pages get stacked (PWG 5100.13 – IPP: Job and Printer Extensions – Set 3, section 5.6.36).
The patch (which I also have applied to the PPD generator of cups-filters) makes this information available in the generated PPD files for driverless printing. Once, the PPD file gets a "*DefaultOutputOrder: ..." line with either "Normal" or "Reverse" as value, the latter indicating that the pages get stackked face-up in the default tray and therefore the pages need to get printed in reverse order (which
pdftopdf
of cups-filters takes care of in this case). Second, if the PPD has an "OutputBin" option, I add a "*PageStackOrder ..." line to each choice of the "OutputBin" option telling whether this bin is face-up or face-down. Also this is taken care of bypdftopdf
(see "*OutputOrder", p124, and "*PageStackOrder", p125, in Adobe's PPD specs).This way printers set up with driverless printing of CUPS should print the jobs in the correct order with respect to the fact that they stack their output face-up or face-down.