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

... 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?
lprinteracts withcupsdirectly, the print to file option completely bypasses the printing server. it probably doesn't call a command, it just invokes the cairo renderering function in a different way so it generates pdf, postscript or svg output to a file.evinceprint dialog; unfortunately, I cannot see any command line switches byevincethat would do something like this.. Cheers!GtkPrintUnixDialog. If you want to implement your own tool that launches that dialog here's an example inpygobject. I'm posting this as a comment because as far as I know there is no command that does what you want (so there's no answer to your question). The print dialog runs aGtkPrintJob(see documentation) which may use acairo+postscriptbackend to get the surface and print the document.