Repository navigation
pdftops: do not let pstops reverse pages again after pdftopdf - #122
Merged
tillkamppeter merged 1 commit intoNov 22, 2026
Merged
Conversation
When the input comes from pdftopdf, ppdFilterPDFToPS() removes "OutputOrder" from the options for pstops, as pdftopdf has already put the pages into the right order. But without "OutputOrder", pstops falls back to the PPD's default output order (*PageStackOrder of the default output bin, *DefaultOutputOrder) and reverses the pages a second time if that is "Reverse". So on PostScript PPD queues with a face-up output bin, every job that pdftopdf reverses comes out in the wrong order: jobs with an explicit "outputorder", and, with the QPDF-based pdftopdf of libcupsfilters 2.0.x/2.1.x, also jobs without one, as it reverses them from the printer's default output bin. Pass "OutputOrder=Normal" to pstops in this case, as is already done for "Collate", so that the output order is only applied by pdftopdf. Queues whose PPD defaults to normal order are not affected. The PDFio-based pdftopdf of libcupsfilters 2.2.x lost that printer default, so there jobs without "outputorder" currently get their reversal from pstops only. This needs OpenPrinting/libcupsfilters#366, which restores it in pdftopdf. Fixes OpenPrinting#119.
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.
Fixes #119.
When pdftopdf has run,
ppdFilterPDFToPS()removesOutputOrderfrom the pstops options, but pstops then falls back to the PPD's default output order and reverses a second time. This passesOutputOrder=Normalto pstops in that case, like the existingCollatehandling, so only pdftopdf applies the output order.This bug predates the PDFio transition: the QPDF-based pdftopdf also reversed these jobs from the printer default. The PDFio-based pdftopdf currently skips that default, which OpenPrinting/libcupsfilters#366 restores, so this should be merged together with #366. On its own, jobs without
outputorderon face-up PostScript queues would lose their only reversal.Testing
Real
pdftopdf→pdftopschain, 3-page PDF, PostScript PPD with*PageStackOrder FaceUp: Reverse(same results with*DefaultOutputOrder: Reverse):outputorder=normaloutputorder=reversesides=two-sided-long-edgeWith a PPD defaulting to normal order, the output is unchanged.
make checkpasses (14/14).