“Print to File” and can it be used from command line

command linegnomeprinting

When you select "Print to File" in a Gnome print dialog (not cups-pdf):

print-to-file

… what is the actual command that gets executed? (I'm interested in the postscript variant, as on the image)

On the other hand – maybe there isn't a command call; maybe it is gtk_print_operation_set_export_filename from The new Gtk+ Printing API?

In any case – is there a way for me to utilize this particular code from the command line (not pdf2ps and the like)? Say, by using lpr to "print to file" to a postscript file – as if I was using the dialog above?

Best Answer

You could use the cups-pdf package as a solution independent from gnome. After installing the package, add the PDF printer using the cups webinterface at http://localhost:631 as described here ('General' as printer manufacturer, CUPS-PDF as driver).

For your convenience, change the output directory with the option Out in /etc/cups/cups-pdf.conf to, like, ${HOME} or whatever you want. Then do as suggested by @Noam to print to file.

Related Question