Subj : Re: Print to JPEG To : comp.os.linux From : rodsmith Date : Wed Jun 23 2004 08:34 pm In article , Minderbinder writes: > > Care to specify? Most people know that we can use gs to process a > postscript file using a variety of output filters (PDF, jpeg, png etc.), > but how can this program be used as a virtual printer? > > Can you give an example that would allow creation of a CUPS printer which > passes its output to gs (and hence arbitrary file formats)? Automation is > the key... In CUPS, you'd presumably create a backend to pass the file through Ghostscript using appropriate options, but I've not looked into this in detail, so I can't provide any exact information or references. I can provide pointers to information on how to do this using Samba, though: http://www.linux-mag.com/2003-01/guru_01.html This is a piece I wrote for Linux Magazine that describes, among other things, how to use Samba to create PDFs. (I've got somewhat more extended descriptions of the same thing in several of my books, including _Advanced Linux Networking_ and _The Definitive Guide to Samba 3_; see http://www.rodsbooks.com/books/.) Modifying my examples to produce JPEGs or other formats of output should be pretty simple, at least for single-page documents -- just change the -sDEVICE option and (for clarity) the filename. You could then create a CUPS queue that calls the Samba printer share, even if it's running on the same computer. Again, though, this is almost certainly needlessly complex; CUPS is flexible enough that I'd be surprised if it couldn't handle the task by itself, at least with the help of an appropriate backend script. I just don't happen to have a pointer to a how-to document on the topic. If you can't find a specific how-to document, check the main CUPS documentation site (http://www.cups.org/documentation.php) and search for information on CUPS backends, which are the tools that deliver data to a printer. Chances are you can write a simple script as a backend that'll create a JPEG, TIFF, or whatever you want. -- Rod Smith, rodsmith@rodsbooks.com http://www.rodsbooks.com Author of books on Linux, FreeBSD, and networking .