products:ict:linux:pdfjam_pdfjoin_pdfnup
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| products:ict:linux:pdfjam_pdfjoin_pdfnup [2023/07/29 23:50] – wikiadmin | products:ict:linux:pdfjam_pdfjoin_pdfnup [2023/07/29 23:50] (current) – wikiadmin | ||
|---|---|---|---|
| Line 33: | Line 33: | ||
| https:// | https:// | ||
| + | https:// | ||
| + | Printing two pages per sheet from the command line | ||
| + | Asked 7 years, 6 months ago | ||
| + | Modified 1 year, 2 months ago | ||
| + | Viewed 13k times | ||
| + | 16 | ||
| + | |||
| + | Say I start off from a PDF document, say of 12 pages, viewed with evince. To produce another PDF of 6 sheets, with a page setup of two pages per side, I normally use the "Print to File" device listed in the ^P dialogue window. This works out pretty neatly. | ||
| + | |||
| + | I would like to translate this operation for the command line. | ||
| + | |||
| + | To my understanding, | ||
| + | The command lp, which would accept the option -o number-up=2, | ||
| + | I am aware of the post What is “Print to File” and can it be used from command line?. I have installed cups-pdf whereby a new printer named PDF is acknowledged. However, the print quality of a simple text file is way too raw (for example, no print margins to start with). Moreover, if I reprint an existing PDF file on this device, say lp -p PDF existing.pdf, | ||
| + | I had a look at man evince. At the bottom, it touches upon a few print preview options and redirects to a GNOME-developer project page. Admittedly I am not able to make sense and use of it. | ||
| + | Is there actually a way to combine the flexibility of the command line with the print quality that I obtain from that "Print to File" option in the GUI evince? | ||
| + | |||
| + | My test case, again, would be to create from the command line a PDF out of a source document printed with two pages per sheet. | ||
| + | |||
| + | Thanks for thinking along. | ||
| + | |||
| + | pdfcupsevincepdftklp | ||
| + | Share | ||
| + | Improve this question | ||
| + | Follow | ||
| + | edited Apr 13, 2017 at 12:36 | ||
| + | Community' | ||
| + | CommunityBot | ||
| + | 1 | ||
| + | asked Jan 9, 2016 at 21:45 | ||
| + | XavierStuvw' | ||
| + | XavierStuvw | ||
| + | 1,06966 gold badges1616 silver badges4040 bronze badges | ||
| + | Add a comment | ||
| + | 3 Answers | ||
| + | Sorted by: | ||
| + | |||
| + | Highest score (default) | ||
| + | 16 | ||
| + | |||
| + | There is the pdfnup (or pdfjam) command line tool. You can install it from the repositories of your distribution (sudo apt-get install pdfjam for Debian-based distributions, | ||
| + | |||
| + | The default options will take the input PDF file and produce an output PDF with two input pages per page: | ||
| + | |||
| + | pdfnup -o output.pdf input.pdf | ||
| + | Share | ||
| + | Improve this answer | ||
| + | Follow | ||
| + | edited Oct 14, 2016 at 16:56 | ||
| + | terdon on strike' | ||
| + | terdon on strike♦ | ||
| + | 233k6565 gold badges441441 silver badges657657 bronze badges | ||
| + | answered Jan 9, 2016 at 21:56 | ||
| + | pseyfert' | ||
| + | pseyfert | ||
| + | 83877 silver badges2020 bronze badges | ||
| + | 2 | ||
| + | This produces the desired result ahead of engaging with printing commands. Man pages are available on-line from Linux.die.net – | ||
| + | XavierStuvw | ||
| + | Jan 10, 2016 at 12:48 | ||
| + | 1 | ||
| + | For pdfjam you need to add the option --nup 2x1, otherwise it just pipes the document as-is. – | ||
| + | comfreak | ||
| + | Oct 23, 2021 at 19:29 | ||
| + | 1 | ||
| + | Note that the pdfnup script from pdfjam is no more, you'll have to use pdfjam directly. – | ||
| + | vonbrand | ||
| + | Jan 17 at 14:05 | ||
| + | pdfjam sources: github.com/ | ||
| + | milahu | ||
| + | | ||
| + | Add a comment | ||
| + | 3 | ||
| + | |||
| + | To expand on the accepted answer: | ||
| + | |||
| + | Using pdfjam you will need to pass the landscape option as well. The usage is: | ||
| + | |||
| + | pdfjam input.pdf -o output.pdf --nup 2x1 --landscape | ||
| + | Note that the extra --angle 90 might save your day, depending on the orientation of the pages in the original PDF. | ||
| + | |||
| + | Share | ||
| + | Improve this answer | ||
| + | Follow | ||
| + | edited May 23, 2022 at 15:38 | ||
| + | Olivier' | ||
| + | Olivier | ||
| + | 14566 bronze badges | ||
| + | answered Oct 28, 2021 at 8:15 | ||
| + | Lukas Bühler' | ||
| + | Lukas Bühler | ||
| + | 18111 silver badge66 bronze badges | ||
| + | Add a comment | ||
| + | 0 | ||
| + | |||
| + | Yes you can print multiple pages: | ||
| + | |||
| + | command | lpr -P < | ||
| + | Example of use: | ||
| + | |||
| + | ls -l | lpr -P hpprinter -p 2 | ||
| + | Share | ||
| + | Improve this answer | ||
| + | Follow | ||
| + | edited Jan 9, 2016 at 23:13 | ||
| + | Jakuje' | ||
| + | Jakuje | ||
| + | 20.9k77 gold badges5151 silver badges7070 bronze badges | ||
| + | answered Jan 9, 2016 at 22:37 | ||
| + | DnrDevil' | ||
| + | DnrDevil | ||
| + | 23111 silver badge55 bronze badges | ||
| + | 1 | ||
| + | Hi. This answer bumps against the limitation that, if I launch lpr -P PDF -p 2 the quality of the result is way too raw. It is useful if that is not a requirement. – | ||
| + | XavierStuvw | ||
| + | Jan 10, 2016 at 12:45 | ||
| + | Add a comment | ||
products/ict/linux/pdfjam_pdfjoin_pdfnup.1690656617.txt.gz · Last modified: 2023/07/29 23:50 by wikiadmin