When "print-scaling=auto" or "print-scaling=auto-fit" is used, the
input pages are scaled when they do not fit into the output page
size. Often input ad out page sizes are supposed to be equal, for
example both A4, but rounding errors could make the input considered
larger and unnecessarily scaled.
Therefore we add 2% of tolerance before considering an input page too
large.
(manually backported commit
e541dc698f38aaa522f99e23b57c695da2981c29)
bottom or left != right) and for input files containing
pages with different sizes and/or orientations. Fixes
backported from 2.x branch.
+ - pdftopdf: Add 2% tolerance for input size larger than output
+ page when "print-scaling=auto" or "print-scaling=auto-fit"
+ is used and too large input pages should be scaled, fitting
+ documents not. This prevents a random-looking behavior if
+ input and output page size seem to be equal, but in reality
+ there are slight dependencies between size dimensions.
CHANGES IN V1.28.11
for (int i = 0; i < (int)pages.size(); i ++)
{
PageRect r = pages[i]->getRect();
- int w = r.width;
- int h = r.height;
+ int w = r.width * 100 / 102; // 2% of tolerance
+ int h = r.height * 100 / 102;
if ((w > param.page.width || h > param.page.height) &&
(h > param.page.width || w > param.page.height))
{