LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   CUPS command line Duplex Multiple Documents (https://www.linuxquestions.org/questions/linux-general-1/cups-command-line-duplex-multiple-documents-4175557201/)

deerewright 10-26-2015 12:33 PM

CUPS command line Duplex Multiple Documents
 
Is there a command line option in CUPS to print two documents on opposite sides of same page. I have 2 single-page documents that I would like to print to opposite sides of the same page. I want to be able to do this from the command line, so that I can add it as a CRON job. If there is not an 'lpr' command option, anyone have a script that might work?

michaelk 10-26-2015 12:39 PM

Welcome to LinuxQuestions

Yes, http://www.cups.org/documentation.php/options.html

deerewright 10-26-2015 12:45 PM

I have already read the CUPS docs, thank you. I can see how to print multiple documents, and how to duplex, but nothing I have found will do what I am attempting. Could you show an example of how I might accomplish my goal?

michaelk 10-26-2015 12:56 PM

Sorry, I did not read the question correctly...

What type of documents i.e text, otf PDF etc.

Is your printer duplex capable?

deerewright 10-26-2015 01:07 PM

Quote:

Originally Posted by michaelk (Post 5440521)
Sorry, I did not read the question correctly...

What type of documents i.e text, otf PDF etc.

Is your printer duplex capable?


They are both pdf files and are both located in the same folder. My printer is duplex capable. I have tried setting the the default option of duplex (in the CUPS options web interface), and using the following command to print:

Code:

lpr -P HP8500 /path/to/first/file /path/to/second/file
That just prints each document on separate pages with blank duplex (blank back side of page).

michaelk 10-26-2015 01:30 PM

A simple script using pdftk to join the documents together like the example below.

pdftk /path/to/file1.pdf /path/to/file2.pdf cat output /path/to/combined.pdf
lpr -o sides=two-sided-long-edge -P HP8500 /path/to/combined.pdf

https://www.pdflabs.com/docs/pdftk-man-page/

deerewright 10-27-2015 04:24 PM

Quote:

Originally Posted by michaelk (Post 5440539)
A simple script using pdftk to join the documents together like the example below.

pdftk /path/to/file1.pdf /path/to/file2.pdf cat output /path/to/combined.pdf
lpr -o sides=two-sided-long-edge -P HP8500 /path/to/combined.pdf

https://www.pdflabs.com/docs/pdftk-man-page/

That works, thanks, but what if you have two different types of files?

michaelk 10-27-2015 06:29 PM

For text files you can use enscript.

For word processor type files (doc,otf) I believe you can use Libreoffice writer command line to convert them to PDF and then use pdftk as above.


All times are GMT -5. The time now is 02:05 AM.