printing problems

Bill Gribble
Fri, 17 Nov 2000 08:51:25 -0600

On Fri, Nov 17, 2000 at 10:25:46AM +1100, Robert Graham Merkel wrote:
> You mentioned briefly on IRC that you were doing something 
> with printing.  Was that gtkhtml printing, or just checks?

I started cleaning up the gnucash html-widget code to allow a
windowless HTML widget to be embedded in other places (like a pane of
your multi-pane thing) and found that what I wanted was to toss the
whole window-html.{c,h} mess and start over.  While poking through
gtkhtml, I found that it supports the HTML <object> tag is an
interesting way... when it hits the tag, you get a callback which is
passed the relevant info from the form and a GtkContainer that you can
stick the embedded object in.

The version of gtkhtml I have installed (debian package 0.6.1-5) is
partially broken WRT both the <iframe> and <object> tags, but either
one of these will allow some level of both embedding and templatizing.
For example, 

<object classid="gnc-guppi">
  <param name="object-type" value="pie-chart">
  <param name="plot-type" value="average-balance">
  <param name="account-name" value="My Bank Account">
  <param name="average-window-size" value="3 days">

With suitable conventions for encoding the object's parameters (they
get passed in via a GHashTable) we can use this as a handy way of
embedding a LIVE guppi plot in the HTML widget.  I have *no* idea how
this interacts with printing.  We can also embed any kind of GTK
controls we find useful, live registers, or any other manner of
craziness that we want to implement an appropriate "classid" handler
for in the gnc-html <object> handler.

The <iframe> tag ("inline" frame) may easily allow us to embed
sub-reports and/or scheme code output directly into a "template" HTML
file, which makes the HTML look sort of like what Linas was hoping it

 <iframe src="gnc-scheme:(scheme-func-to-spew-html)">

Since we handle the parsing of URLs in gtkhtml, it's easy to add a way
of interpreting the "gnc-scheme:" protocol string and evaluating the
rest of the URL appropriately.  It may be better to use the <object>
tag for that too, but I'm not exactly sure if it will DTRT:

 <object classid="gnc-inline-scm">
   <param name="form" value="(scheme-func-to-spew-html)">

> It's just that we're still having problems with table splitting,
> despite the latest CVS gtkhtml supposedly fixing this.  Is it
> somehow possible that the interface has changed in some obscure
> fashion causing the page splitting to break?

I have no idea.  There's really no "interface" to the gnome-print
functionality, just gtk_html_print(GtkHTML *, GnomePrintContext *);
I'll have a look when this new HTML code gets more on its feet
(hopefully today).