Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDF is printed incorrectly with 'number-up' and 'page-ranges' #2643

Closed
michaelrsweet opened this issue Dec 27, 2007 · 3 comments
Closed

PDF is printed incorrectly with 'number-up' and 'page-ranges' #2643

michaelrsweet opened this issue Dec 27, 2007 · 3 comments
Milestone

Comments

@michaelrsweet
Copy link
Collaborator

Version: 1.2.3
CUPS.org User: drakamakafon

PDF is printed incorrectly when 'number-up' and 'page-ranges' options are specified simultaneously.

Tested OS:
1.1.23 (SuSE 9.3, package name: cups-1.1.23-7.1)
1.1.23 (Mandriva 2006, package name: cups-1.1.23-17mdk)
1.2.3 (Mandriva 2007, package name: cups-1.2.3-5mdv2007.0)
1.2.4 (Ubuntu 6.10, package name: 1.2.4-2ubuntu3)

After investigation I found that 'pstops' from different version of cups produces different output when 'number-up' and 'page-ranges' are specified simultaneously.

test7.ps - postscript file (7 pages)

/usr/lib/cups/filter/pstops 12345 user title 1 "-o page-ranges=1-3 -o number-up=2" test.ps > pstops-out

1.1.23 (SuSE 9.3, Mandriva 2006)
######### #########
#1 # #3 #

# #

######### #########
#2 # #blank #

# #

######### #########
Looks like operations are performed in the following order:

  1. Select pages according to 'page-ranges' value
  2. Layout selected pages according to 'number-up' value

1.2.3 (Mandriva 2007) 1.2.4 (Ubuntu 6.10)
######### ######### #########
#1 # #3 # #5 #

# # # #

######### ######### #########
#2 # #4 # #6 #

# # # #

######### ######### #########
Looks like the same operations are performed in reverse order, i.e:

  1. Layout ALL pages according to 'number-up' value
  2. Select pages from new page sequence according to 'page-ranges' value
    The same behaviour in later versions (v1.3 Fedora 8). Is it the feature of newer 'pstops' or bug?.
    ASAIK 'pdftops' doesn't take into account 'number-up' option so after http://cups.org/str.php?L273 is resolved the 'pdftops|pstops' pipe may produce strange output.

Example:

lpr "-o page-ranges=1,3-4,6 -o number-up=2" test.pdf

  1. 'pdftops' output:
    ### ######### ######### ######### #########

    # # # # # # # # # # #

    # # # # # # # # # # #

    # # # # # # # # # # #

    # # # # # # # # # # #

    Missing links and out-of-date systems overviews on documentation page #1 # #blank # connect from cups client to bsd lpd server fails : Remote host did not accept control file (100) #3 # CUPS displays PPD options without "*OpenUI" ... "*CloseUI" #4 # #blank # ESP GhostScript: "psmono" and "psgray" produce shrinked pages #6 # #blank
    ### ######### ######### ######### #########
  2. 'pstops' output:

2.1. Layout ALL pages according to 'number-up' value
######### ######### ######### #########
#1 # #3 # #blank # #blank #

# # # # # #

######### ######### ######### #########
#blank # #4 # #6 # #blank #

# # # # # #

######### ######### ######### #########

2.2. Select pages from new page sequence according to 'page-ranges' value (1,3-4,6)
######### ######### #########
#1 # #blank # #blank #

# # # #

######### ######### #########
#blank # #6 # #blank #

# # # #

######### ######### #########
that are 1,3-4 from the previous step (page 6 became out of page range after n-up).
So totally 3 pages are printed (3rd page is empty). It looks pretty strange in respect that page-ranges=1,3-4,6 was requested. Either 'pstops' should process options in the v1.1 order or 'pdftops' should understand 'number-up' option.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

The 1.1.x (and 1.0.x) behavior was incorrect. According to the IPP specification, number-up is applied first, and page-ranges refers to the imposed pages. Similarly, page-set is applied after imposition.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Reopening - the issue is that STR #273 changed the PDF filter to omit pages that were not needed, but that filtering isn't accounting for number-up processing.

@michaelrsweet
Copy link
Collaborator Author

CUPS.org User: mike

Fixed in Subversion repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant