Repository navigation
Conversation
The generator wrote *DefaultOutputOrder and *PageStackOrder as Reverse only if exactly one of "pagedelivery=faceUp" and "stackingorder=lastToFirst" was in "printer-output-tray", treating them as two independent inversions. They are not: "stackingorder" is prtOutputStackingOrder of the Printer MIB (RFC 3805), where "lastToFirst" means that the back of each page is placed against the front of the previous page, which is what a face-up bin does. So a face-up bin reporting both, like the one of an Epson ET-4950, got Normal and printed the last page on top. Decide by "stackingorder" and use "pagedelivery" or the bin name only without it, as cfIPPReverseOutput() in libcupsfilters does. The PPD generator of CUPS also uses "stackingorder" alone. Both places now use the same helper. Add tests for face-up/lastToFirst, face-down/firstToLast, a "stackingorder" contradicting the bin name, and "pagedelivery" alone. The first and third fail without this change.
xangelix
force-pushed
the
generator-output-order-stackingorder
branch
from
November 21, 2026 23:19
6217d79 to
1040f1b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Assisted by Claude, this PR fixes an issue I was having with my Epson ET-4950. I have manually confirmed the findings, the fix (on my limited hardware), and that the code is reasonable to merge given my own limited understanding of how this fits into the drivers here.
Happy to make changes or take a different approach if requested.
The PPD generator writes
*DefaultOutputOrder/*PageStackOrderas Reverse only if exactly one ofpagedelivery=faceUpandstackingorder=lastToFirstis inprinter-output-tray, as if they were two independent inversions.stackingorderis prtOutputStackingOrder from the Printer MIB (RFC 3805):lastToFirstmeans "the back of the next page is placed against the front of the previous page", which is simply what a face-up bin does. So a face-up bin reporting both gets Normal, and the last page ends up on top.Seen with an Epson ET-4950 (
output-bin-default = face-up,printer-output-tray = ...;stackingorder=lastToFirst;pagedelivery=faceUp;):driverless catgives*PageStackOrder FaceUp: Normal, while a CUPS IPP Everywhere queue for the same printer gets Reverse.This PR decides by
stackingorderand falls back topagedeliveryor the bin name only without it, the same rule ascfIPPReverseOutput()in libcupsfilters; CUPS's own generator also usesstackingorderalone. It also matches libppd's own conversion in the other direction:ppdLoadAttributes()turns*PageStackOrder ...: Reverseintostackingorder=lastToFirst(without output bins, intostackingorder=lastToFirst;pagedelivery=faceUp), which the generator previously turned back into Normal. Both places in the generator now share one helper.Testing:
test_ppd_generator(face-up/lastToFirst, face-down/firstToLast,stackingordercontradicting the bin name,pagedeliveryalone). Without this change the first and third fail.make check: 14/14 pass.driverless cat ipp://<ET-4950>/ipp/printwith this build: only*DefaultOutputOrderand*PageStackOrder FaceUpchange, both to Reverse.*PageStackOrderagain), the generated PPD now gives pages in reverse order (3,2,1); the old PPD gave 1,2,3.Related: #119, OpenPrinting/libcupsfilters#366