[cups.bugs] [LOW] STR #2663: pstops filter produces incorrect output with number-up=2 on some documents

Markus Durzinsky mardur at gmx.net
Wed Jan 9 10:35:55 PST 2008


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

On some documents (ps-files created with LaTeX-beamer package, or with cups
pdftops-filter, see attachment for an example input file (gzipped)) with an
odd number of pages, the pstops filter produces incorrect output with
option 'number-up=2'. The ps-viewer gv is hanging on displaying the last
page. The last page is not printed on an HP LaserJet 4350.

filter/pstops.c (7067 2007-11-09 19:54:09Z mike) contains the code:

if (number && !is_first_page(number) && cupsArrayLast(doc->pages))
{
    pageinfo = (pstops_page_t *)cupsArrayLast(doc->pages);

    start_nup(doc, doc->number_up, 0, doc->bounding_box);
    doc_puts(doc, "showpage\n");
    end_nup(doc, doc->number_up);

    pageinfo->length = cupsFileTell(doc->temp) - pageinfo->offset;
}

which is not executed on the last output page with an odd-page input
document, due to the "!is_first_page(number)". Instead of testing for a
single page on the last output page, the filter should check for activated
number-up printing.

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

I am not familiar with postscript, so I don't know what start/end_nup are
doing together with 'showpage', but the change above resolved the problem.
This code is working fine on all tested documents with and without
number-up printing.

I am using cups 1.3.5 from subversion repository r7167.
Compiled with Sun Studio 11 on a sparcv8, Solaris 9/10.

Link: http://www.cups.org/str.php?L2663
Version: 1.3.5
-------------- next part --------------
A non-text attachment was scrubbed...
Name: w1-nup.ps.gz
Type: application/octet-stream
Size: 62938 bytes
Desc: not available
URL: <http://lists.cups.org/pipermail/cups-devel/attachments/20080109/01069497/attachment.obj>


More information about the cups-devel mailing list