1

Env: xfce4 + ubuntu + bash

Printer is configured by hplip.

lp -o landscape -o fit-to-page -o media=A4 -o number-up=2 -o number-up-layout=lr -o page-ranges=320,289,321,300 ~/Documents/test.pdf 
lp: Bad page-ranges values 289-289.

The pdf file has more than 500 pages. I want to incorporate a command in a script which can print random pages I select 2 pages on 1 side of an A4 sheet.

4
  • 320,289,321,300 try selecting pages to print in numerical order (289,300,320,321). It looks like lp cannot seek in a .pdf.
    – waltinator
    Dec 11, 2015 at 19:13
  • But I dont want to print in numnerical order. :)
    – lal_bosdi
    Dec 11, 2015 at 22:54
  • Then, print in 3 lp commands - (320), (289,321) and (300). I repeat lp can't seek.
    – waltinator
    Dec 11, 2015 at 23:26
  • then it breaks another constraint I mentioned above. "print random pages I select 2 pages on 1 side of an A4 sheet"
    – lal_bosdi
    Dec 12, 2015 at 1:13

1 Answer 1

1

lp can't seek in a PDF, but pdftk can. Try something like this:

pdftk test.pdf cat 320 289 321 300 output - | lp

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .