]> git.ipfire.org Git - thirdparty/cups-filters.git/commit
libcupsfilters: Make pdftopdf() correctly working with "landscape" option
authorTill Kamppeter <till.kamppeter@gmail.com>
Sun, 3 Apr 2022 17:28:17 +0000 (19:28 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Sun, 3 Apr 2022 17:28:17 +0000 (19:28 +0200)
commit9b86754edb4362c0765469eac1c315904cc295d9
tree427012dd1edebfcf84a65a290e85322c65c11496
parent8bf3f5c232f1d3d85703cdbf35a737e21a2ae0f4
libcupsfilters: Make pdftopdf() correctly working with "landscape" option

The "landscape" option rotates the input pages by 90 degrees, in the
direction given by the "*LandscapeOrientation" in the PPD file.

The "orientation-requested" option/IPP attribute rotates the page
according to its value: 3: No rotation; 4: 90 degrees anticlockwise;
5: 90 dgrees clockwise; 6: 180 degrees (upside-down).

After that, at least when not suppressed via "nopdfAutoRotate"
("pdfAutoRotate=false") option, auto-rotation kicks in, rotating the
page by 90 degrees (direction according to "*LandscapeOrientation" in
the PPD file) if the orientations of the input page and the output
page mis-match.

See also:

https://openprinting.github.io/cups/doc/options.html
https://wiki.debian.org/CUPSPdfToPdf

When applying the "landscape" or "orientation-requested" option the
following bugs occured:

1. The page image did not only get rotated but also de-centered. See
issue #456.

2. When cropping ("print-scaling=none" or "print-scaling=fill")
portrait-oriented pages got wrongly cropped.

3. When using N-up ("number-up" option) division of the output page
inbto cells happened in the wrong oriantation.

This commit fixes these issues.
cupsfilters/pdftopdf/pdftopdf_processor.cc