margins for printing gtkhtml?

Lauris Kaplinski lauris@ximian.com
11 May 2001 21:10:02 +0200


Hello!

On 11 May 2001 10:23:58 +0200, Radek Doulik wrote:
> On 04 May 2001 18:12:57 +1000, Robert Graham Merkel wrote:
> >     I'm one of the gnucash hackers.  We corresponded 
> > a few months ago on issues relating to gtkhtml table display.  We seem
> > to have come across another issue and were wondering if you could help, 
> > or at least forward it on to the right person?
> >     gtkhtml seems to default to extrordinarily wide margins
> > when printing html documents - at least, it does for me and other A4-size
> > paper 
> 
> This is weird, as gtkhtml uses A4 size. I am not sure what is the
> standard way of printing settings like paper size, resolution, ...
> Lauris?

For current stable gnome-print, you have to use

  gnome_print_context_new_with_paper_size

But this has real mening only for preview. For PS you can print wherever
you want - actual output is simply clipped to printer margins.
In HEAD gnome-print, there will be a way to query/set actual paper size
plus query physical margins - but it still remains the application 
responsinbility to set logical margins and fit all printout inside
these.

> > users.  As gnucash tends to use tables
> > that can get rather wide, this is rather restrictive.  
> > 
> > Is there an existing interface/API that can be used to configure the
> > margins
> > (and papersize, for this matter)?  If not, how difficult would that be
> > to add?
> 
> I think it's not very usefull when each library will have its own way of
> setting these standard parameter, again Lauris could you please comment
> on this?

Well, depending on application, you probably want to manage certain set 
of paper data youself nevertheless.
Gnome-print will only deal with physical page sizes - i.e. the ones, 
what printer actually supports. There is mechanism in HEAD to merge
application and printer pages - i.e. if you select A4 from printer 
setup, application get notified and vice versa. Still there certainly 
are cases where application wants to ignore printer page size - like
preformatted layouts.
Also gnome-print is not interested in logical margins, headers, footers
and so on.
But it would be certainly good idea, to create standard widget set for
such things - either in gnome-print frontend API, gal or gnome-libs.
Together with actual text formatting API (gnome-print core
should not do any text-layouting itself). I am not working on anything
like that, but if nobody volunteers, I have to start with text part
myself some time, to make gnome-print usable in Pangoified world.

Best wishes,
Lauris Kaplinski

> On the other hand, I am thinking about some more general interface, when
> calling application (like GnuCash) gives to GtkHTML GnomePrintContext
> and printing area (like x_offset, y_offset, width, height) and then will
> call for each page print.
> 
> So the interface could look like this:
> 
> void     gtk_html_print_begin (GnomePrintContext *pc, gdouble x_off, gdouble y_offset, gdouble width, gdouble height);
> /* return value: FALSE - nothing printed, we are on the end of print, TRUE otherwise */
> gboolean gtk_html_print_page ();
> void     gtk_html_print_end ();
> 
> OK, so what do you think?
> 
> Cheers
> Radek
> 
> ________________________________________________________________________
> Radek Doulik        Hacker  monkey
> rodo@ximian.com     Ximian, Inc.