- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: CUPS on SuSE 10. need ascii print to file
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2010 11:09 AM
тАО08-03-2010 11:09 AM
I need to configure an ascii printer, in CUPS version 1.1, to send its output to a file.
I've figured out how to configure a null printer but need the output to go to a specific path and filename.
There is probably a way to change something in the PPD file but I cant find a description of the various options in that file.
There is a lot of documentation about CUPS out there but all of it assumes that you want to print to an actual printer.
Any suggestions? Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2010 11:52 AM
тАО08-03-2010 11:52 AM
SolutionFileDevice Yes
in your /etc/cups/cupsd.conf.
This setting will allow you to create printer devices using the "file:/filename" URL, like "file:/specific/path/filename" for example.
Such a printer cannot accept print jobs of type "application/octet-stream", i.e. they must be recognizable by CUPS as something other than raw print data.
The file will contain the output of the latest print job only: subsequent print jobs will overwrite previous ones. The file will be written using the identity of the user cupsd runs as ( = usually as root).
Once you've created the necessary file printer(s), you can reset the FileDevice setting back to the default value. The FileDevice setting in /etc/cups/cupsd.conf only controls whether new file printers can be created or not; it has no effect on already existing print queues that use a printer URL of type "file:".
------------
It's also relatively simple to create your own CUPS printing backends using scripts. Here are two examples, a simple one and an advanced one:
http://osdir.com/ml/printing.cups.devel/2004-10/msg00007.html
(This was a result of googling for "cups print to file" and quickly browsing through the first three links, by the way.)
------------
If the application that produces the print-out data accepts a custom print command, you could side-step the entire CUPS printing system, by supplying as a "print command" a small script that essentially contains only a command like this:
cat > /specific/path/filename
(Normally, the application will simply pipe its print-out data to the appropriate "lp" or "lpr" command. You'll only need to make the application to pipe its print-out to a command or script that writes standard input to a file of your choosing, and your problem is solved.)
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-04-2010 08:02 AM
тАО08-04-2010 08:02 AM
Re: CUPS on SuSE 10. need ascii print to file
I admit this is a kludge, wasnt my idea.
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2010 08:29 AM
тАО08-10-2010 08:29 AM
Re: CUPS on SuSE 10. need ascii print to file
lpadmin -p rptx -v file:/var/opt/rpt/rptx -P /usr/share/cups/model/laserjet.ppd
But when we attempt to print to this file the result is data that is not in a readable format.
Which model file will give me plain ASCII output (in the file) ?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2010 01:15 PM
тАО08-10-2010 01:15 PM
Re: CUPS on SuSE 10. need ascii print to file
For text-only output, attached is a textonly.ppd file that comes with the standard CUPS installation on Debian 5.0. Doesn't SuSE 10 have it?
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-10-2010 01:20 PM
тАО08-10-2010 01:20 PM
Re: CUPS on SuSE 10. need ascii print to file
MK
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-12-2010 06:32 AM
тАО08-12-2010 06:32 AM
Re: CUPS on SuSE 10. need ascii print to file
Many Thanks!!
Now, they just need one more thing.
Can the generated file have a random number as part of the filename so we dont keep overwriting the same file ?
I tried passing the following to the lpadmin command -v option:
file:/var/opt/rpt/fsp.$$
thinking that the $$ would be replaced with the process ID every time a new output file was generated. Unfortunately this is interpreted once when the lpadmin command is executed. I also tried backslashes and quoting.
Is what I am asking for even possible ?
Thanks in advance and sorry to be a pest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-14-2010 10:22 AM
тАО08-14-2010 10:22 AM
Re: CUPS on SuSE 10. need ascii print to file
>thinking that the $$ would be replaced with the process ID every time a new output file was generated.
This is the PID of the shell, which won't change, unless a subshell is created.
>Is what I am asking for even possible?
Sure, create another dummy shell, for a real shell:
file:/var/opt/rpt/fsp.$($SHELL -c 'echo $$')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-17-2010 06:18 AM
тАО08-17-2010 06:18 AM
Re: CUPS on SuSE 10. need ascii print to file
Does CUPs, at any point, have a script that controls what the generated filename looks like ? That would be appear to be the only way to achieve this since the lpadmin command expects a literal expression as an argument to the -v option.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-02-2010 09:52 AM
тАО09-02-2010 09:52 AM
Re: CUPS on SuSE 10. need ascii print to file
http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1446100
Unix operates with beer.