Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 07-02-2007, 08:27 PM   #1
LQ Newbie
Registered: Sep 2004
Location: Internet
Distribution: MacOS X
Posts: 26

Rep: Reputation: 15
Question KDEPrint virtual printer that pipes content to custom shell script?

Hello, is it possible to make a virtual printer in KDEPrint that pipes the content printed through KDEPrint to a custom shell script? The idea here would be to pipe the content to a shell script such that a pdf is made and then emailed. I realize that KDEPrint can print to PDF on its own but I don't believe it can then automatically email that PDF somewhere can it? Perhaps even better, would there be a way to have KDEPrint execute a shell script after generating the PDF file such that the shell script would take care of emailing the PDF file after the PDF is generated? Any ideas on how this could be achieved would be greatly appreciated, thanks!

Last edited by hexstar; 07-02-2007 at 08:29 PM.
Old 07-03-2007, 10:17 AM   #2
Registered: Oct 2004
Location: Germany
Distribution: Debian
Posts: 274

Rep: Reputation: 34
yes, you can use scripts as print commands.

create a new special/pseudo printer.
add "exec:/your_script_file" to the prerequisites list
select "edit command"
as "command", enter "your_script_file %filterargs %filterinput"
to the panel below "command", you can add parameters that can be configured using the printer settings dialog and that will be passed as arguments (on the right side, "format" will hold the result, e.g. "--target=%value". for type "list", the box below will list all possible options, where the "name" will replace %value above.)

For "input from", enter "< %in", for "pipe", enter "-". output will be grayed.

Now, your print job (postscript data) will be send to stdin of your_script_file.
do whatever you want with the data...

I'm rather sure you can also use a temp file as input (given by param to your script), but I can't remember how. see kdeprint help, I found the documetnation about filters there (nothing else is this).


filter, print, solution

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script for changing a txt file content Flobsi Linux - Newbie 3 10-06-2006 04:10 AM
shell script for changig txt-file content Flobsi Programming 1 10-05-2006 06:46 PM
modify content in a file using shell script fjkum Linux - Newbie 2 08-03-2006 05:46 AM
Shell script: substitute a file's content according to a map? Chowroc Programming 11 11-15-2005 05:08 AM
Trouble with KDEprint (cannot delete printer) shortname Linux - Software 1 03-26-2005 09:02 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:42 AM.

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