apple / cups

Apple CUPS Sources
https://www.cups.org
Apache License 2.0
1.87k stars 458 forks source link

Printing ISO media size documents n-up onto non-ISO media sizes wastes space #3560

Closed michaelrsweet closed 12 years ago

michaelrsweet commented 14 years ago

Version: -feature CUPS.org User: twaugh.redhat

If an A4 PDF document is printed with number-up=2 onto a US Letter page, there is wasted space at the sides which it is possible to reduce.

This is because the A4 PDF document is first converted to PostScript in US Letter size (with pdftops or ghostscript), widening each page in the document.

If the document were converted to PostScript using the document's native page size (A4 in this case), it would be possible to lay out the document's pages at a slightly larger scale in the resulting output.

In other words, rather than increasing the width of each document page to match US Letter aspect ratio, it would be better to increase the height of each document page as it is laid out in the output.

Original bug report: https://bugzilla.redhat.com/show_bug.cgi?id=543183

michaelrsweet commented 12 years ago

CUPS.org User: amcnabb

I am still experiencing this problem with cups version 1.4.8. An easy way (for me) to reproduce the problem is to find a PDF of a book or scientific journal, which do not tend to use 8 1/2 by 11 inch paper sizes.

For example, the journal Evolutionary Computation gives PDFs which are 7.00 x 10.00 inch. When these pages are printed 2-up, there are large amounts of wasted space. Since the 7 x 10 aspect ratio is more narrow than letter paper, there should be very little extra blank space.

michaelrsweet commented 12 years ago

CUPS.org User: amcnabb

By the way, I think that this is a bug rather than a feature request, but that's just my opinion.

michaelrsweet commented 12 years ago

CUPS.org User: mike

We use the bounding box in the PostScript file, if present, to control the scaling. If no bounding box is present or is not correct then you will get incorrect/non-optimal scaling (GIGO).

Not much we can do, sorry...

michaelrsweet commented 12 years ago

CUPS.org User: twaugh.redhat

This isn't to do with incorrect bounding boxes. This happens with an ideal bounding box, and is a flaw (or at least a missed optimization) in the algorithm CUPS uses to map with n-up onto media of a different size.

When a document containing ISO A4 pages is mapped 2-up onto US Letter, CUPS first adjusts the A4 pages to US Letter by making them wider, and then maps them onto the US Letter output.

Instead it should ideally keep the original media size when packing 2-up. (I appreciate this makes the maths harder...)