LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-26-2015, 12:33 PM   #1
deerewright
LQ Newbie
 
Registered: Oct 2015
Distribution: Ubuntu, Raspian
Posts: 21

Rep: Reputation: Disabled
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?
 
Old 10-26-2015, 12:39 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Welcome to LinuxQuestions

Yes, http://www.cups.org/documentation.php/options.html
 
Old 10-26-2015, 12:45 PM   #3
deerewright
LQ Newbie
 
Registered: Oct 2015
Distribution: Ubuntu, Raspian
Posts: 21

Original Poster
Rep: Reputation: Disabled
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?
 
Old 10-26-2015, 12:56 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Sorry, I did not read the question correctly...

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

Is your printer duplex capable?

Last edited by michaelk; 10-26-2015 at 12:58 PM.
 
Old 10-26-2015, 01:07 PM   #5
deerewright
LQ Newbie
 
Registered: Oct 2015
Distribution: Ubuntu, Raspian
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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).

Last edited by deerewright; 10-26-2015 at 01:12 PM.
 
Old 10-26-2015, 01:30 PM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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/
 
1 members found this post helpful.
Old 10-27-2015, 04:24 PM   #7
deerewright
LQ Newbie
 
Registered: Oct 2015
Distribution: Ubuntu, Raspian
Posts: 21

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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?
 
Old 10-27-2015, 06:29 PM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Open Documents/File with Specific Application in Command Line newbie202 Linux - Newbie 8 05-14-2014 03:34 AM
CUPS duplex (Duplex= sides=) arizonagroovejet Linux - General 6 11-08-2011 07:29 AM
LXer: Tutorial: Linux Command Line For Beginners: Finding Help Documents LXer Syndicated Linux News 0 01-05-2009 03:30 PM
Printing PDF Documents from command line with PCL commands. nivantha Linux - Newbie 5 02-15-2008 02:56 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration