pstops number-up with incorrect last page

Markus Durzinsky mardur at gmx.net
Wed Jan 9 06:29:09 PST 2008


> Markus Durzinsky wrote:
> > The pstops filter is producing incorrect output with number-up=2 on some documents.
> > ...
> > To resolve this, I did the following:
> > filter/pstops.c (7067 2007-11-09 19:54:09Z mike) contains some code
> >
> > if (number && !is_first_page(number) && cupsArrayLast(doc->pages)) {
> >   ... nup-stuff
> > }
> >
> > which is not executed on the last output page with an odd-page input document, due to the "!is_first_page(number)".
> >
> > I just removed the !is_first_page(number) test, so the command is now
> > if (number && cupsArrayLast(doc->pages)) { ... nup-stuff ... }
> > and everything works fine.
> >
> > The resulting ps-file is fully printable and can be viewer with gv.
> >
> > So, why should start/end_nup not be executed on the last output sheet containing only a single page?
>
> It should be, but the best thing to do is file an official bug report
> on cups.org.

I examined this bug a bit further. Now the printer is printing an empty page after documents without number-up (number-up=1). The number-up functions should only be called if number-up is truly active. IMHO the code has to be the following:

if (number && (doc->number_up > 1) && cupsArrayLast(doc->pages)) {
  ... nup-stuff
}

The original condition !is_first_page(number) is sufficient but not necessarily be true for (doc->number_up > 1), thus the confusion in some odd-paged documents.

This code is now working fine with and without number-up printing.

I am going to make a bug report about that.





More information about the cups mailing list