Hello,
I don’t have much experience with GTK, and I am having some trouble with GtkPrintOperation. I am trying to add printing support for Simon Tatham’s Portable Puzzle Collection in the GTK frontend. It is sort of working, but there are a few problems:
- It prints twice as many pages as it should, with the last pages being blank.
- When in landscape mode, the pages are printed in portrait mode, although the content is aligned for landscape mode. The extra blank pages are printed in landscape mode.
- Reverse portrait mode is the same as portrait mode and reverse landscape mode is the same as landscape mode (probably the same cause as above).
I’ve scoured the Web for a solution, but to no avail.
I paginate everything in the begin-print
handler, print_begin()
. I call gtk_print_operation_set_n_pages()
with the correct number of pages and I end each page with cairo_show_page()
. All rendering is done with Cairo.
You can find a patch on GNOME Pastebin with my code that can be applied on top of the latest commit (currently 1c0c49d
). (Is this the preferred way to attach files?)
I feel like there is something simple I’m missing but I don’t know what it is…
Also, if it matters, I’m using Debian GNU/Linux bullseye (testing).
Thanks in advance,
Asher