I searched a bit on the internet and this is my conclusion (pretty much what you already said):
GtkPrintUnixDialog has to be fed a postscript file.
I'm a bit undecided, but I think GtkPrintOperation is the best option (though it may be hard to draw the text with Cairo) because it is more high-level than GtkPrintUnixDialog.
Double 12
2008/9/24 Tobias Heinzen
<address@hidden>
Double 12 wrote:
I managed to print a document with GtkPrintUnixDialog! Yay, but now I have a gigantic heap of paper on my desk ^^.
hehe ^^
And the printer gives an error message "can not get the ticket cache for USER".
could be printer specific.
See how well the printing goes on your computer/printer and have a look at the code.
i will sure do.
The way to tell what I want to print is a bit weird. I have to insert the file via gtk_print_job_set_source_file, which is designed for PDF and PS files.
well we could use tools like a2ps to create a PS file for the printing job, but that will add a dependency to beaver (a2ps is not installed on most distros i think).