Re: GtkPrintOperation; request for assistance



Hi Emmanuele,

Thank you for your reply.

[...], instead of generating a massive string and then
sending it to lpr, [...]

I'm slightly confused, is that a description of what my code is
currently doing? If it is: I was unaware that the code is generating a
massive string.

My intention and understanding was that it sets margins and a font,
then sets the starting location to the top-left with cairo_move_to(),
and then starts making multiple PrintIt() calls.

Each PrintIt() call
- sets and shows text with pango_layout_set_text() and
  pango_cairo_show_layout(), and subsequently
- prepares for the arrival of additional text by updating the output
  location to the next line with cairo_rel_move_to().

I was hoping a cairo_rel_move_to() call to a location below the bottom
margin would automatically trigger the library to increment the page
number.

A more general remark. It's unfortunate that the GtkPrintOperation
documentation lacks (a link to) source code of a, as small as possible
but still complete, stand-alone example program that allows the user to
select a file of any size, and then pick a printer, paper size and
orientation, including preview option, and print. Such an example would
be user-friendly. Users, in this context, being programmers who work
with GTK+ and would like to use GtkPrintOperation.

I lack the energy to study GNOME Dictionary's gdict-print.c file in
hopes of solving the bug. I thought that my current code related to
printing is close to being correct. If I can't use PrintIt() as I'm
currently doing, I don't see myself rewriting what's necessary to make
it work.

How can I be so far away from a solution that I would need to study the
code of another program? I've already invested many hours into creating
its current printing functionality.

Best regards,
Norbert


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]