Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-15-2014, 09:14 PM
|
#1
|
LQ Newbie
Registered: Jan 2014
Posts: 5
Rep: 
|
cups print job and save PDF copy
Greetings
I want cups to print job at same time save a PDF copy. I have installed cups and can print to physical printer I have as well setup cups-pdf and I can print to it to generate the PDF under user directory's. the challenge is I want a script to trigger cups-pdf to save pdf under users directory each time I print to physical printer. pls help
|
|
|
01-16-2014, 12:43 AM
|
#2
|
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,700
|
if you need to do this in the terminal
then wright a print launcher script to make a shadow copy
but if you already have a pdf open in Ockluar then why not just "save copy as "
|
|
|
01-16-2014, 02:30 AM
|
#3
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,575
|
Quote:
the challenge is I want a script to trigger cups-pdf to save pdf under users directory each time I print to physical printer. pls help
|
There is some information here about a script to move a .pdf file to a user's directory. Should not be hard to add an output to the physical printer. http://slackwiki.com/PDF_Printing
Last edited by allend; 01-16-2014 at 09:27 AM.
|
|
|
01-16-2014, 04:47 AM
|
#4
|
LQ Newbie
Registered: Jan 2014
Posts: 5
Original Poster
Rep: 
|
Thank you for the reply. Let me be more explicit. The cups-pdf works perfectly when printed on it (stand-alone). the physical printer works well too(stand-alone).
What i want to achieve is to print to physical printer(on paper) and at the same time automatically generate pdf of the job printed.
|
|
|
01-16-2014, 05:16 AM
|
#5
|
LQ Guru
Registered: Dec 2008
Location: Westgate-on-Sea, Kent, UK
Distribution: Debian Testing Amd64
Posts: 5,465
Rep: 
|
I'm not sure I understand what you want. What is the file type of the original document that you want to print? Usually the application that created it will have a print menu with a "print to file" option. But again I'm not really sure what you want to do exactly.
jdk
|
|
|
01-16-2014, 05:41 AM
|
#6
|
LQ Newbie
Registered: Jan 2014
Posts: 5
Original Poster
Rep: 
|
i have setup printer from cups and share it with samba.
the printers are as follows
Printer1
Printer2
Cups-PDF-Printer
samba users will print to Printer1 or Printer2 for paper works. I want to monitor the content of the printed jobs so I need to make Cups-PDF-Printer to automatically save/print copy of the job send to Printer1 or Printer2 as pdf.
|
|
|
01-16-2014, 08:14 AM
|
#8
|
LQ Newbie
Registered: Jan 2014
Posts: 5
Original Poster
Rep: 
|
@michaelk that was a good link. However the script place the print request on Cups-PDF printer before printing the job.
In my case I needed the Printer to print the job first and then create PDF. reason being that i have two or more printers with group permission. So i need that script to work in reverse order. pls help.
|
|
|
01-16-2014, 09:26 AM
|
#9
|
LQ 5k Club
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,575
|
You can set up a multiplex printing queue. e.g. http://aplawrence.com/Unixart/dual_print.html
|
|
1 members found this post helpful.
|
01-16-2014, 09:29 AM
|
#10
|
Moderator
Registered: Aug 2002
Posts: 26,853
|
This would be the printer1 print command script. I would guess that additional steps are required to save the pdf file in a specific directory.
Quote:
#!/bin/sh
# prints to physical printer
lpr -P printer1 $1
# prints to cups-pdf
lpr -P cups-pdf $1
#Delete spooled file, change path as necessary
rm /var/spool/samba/$1
|
Last edited by michaelk; 01-16-2014 at 09:34 AM.
|
|
|
01-16-2014, 10:50 AM
|
#11
|
LQ Newbie
Registered: Jan 2014
Posts: 5
Original Poster
Rep: 
|
@michaelk thank you once more. I must really be doing something wrong. when i run the script from shell and try printing it didn't work rather it gave rm: cannot remove `/var/spool/samba/': Is a directory. Pls guide me where to run the scrip.
|
|
|
01-16-2014, 11:09 AM
|
#12
|
Moderator
Registered: Aug 2002
Posts: 26,853
|
The $1 is a command line argument. When windows prints a document to samba it saves it in the /var/spool/samba/ directory, then passes the name of the spooled file as a command line argument to your print script. If you are not running the script without an argument like
myscript testfile
then you you should see this error. This spooled file is not automatically deleted which is why I added the line to delete. While you are testing your script I suggest commenting the line with a # so it is not executed.
|
|
|
All times are GMT -5. The time now is 07:04 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|