Re: Print preview widget



On Thu, 2008-04-17 at 17:10 -0400, Jody Goldberg wrote:
> On Wed, Apr 16, 2008 at 12:46:22PM -0500, Cody Russell wrote:
> > I was thinking that it would be nice if there was an integrated print
> > preview widget in GTK+, that would be available cross-platform and
> > wanted to check with people here before I commit much time to this.
> > Right now we're spawning another process to do this, and I think an
> > integrated widget would be much nicer.
> > 
> > Thoughts?
> 
> +1
> 
> 1) It allows user modification from within previewer
>     - page re-ordering
>     - inserting page breaks
> 
> 2) It would help get preview working on win32, generating an emf is
>    and using the viewer is not workable.
> 
> The main upside to the current approach is that it avoids the
> unacceptably vast memory footprint from libgnomeprintui's preview.
> It would record a stream of drawing cmds _in memory_ and replay them
> for the preview.   For a large or complex file (eg a spreadsheet
> with gridlines) that can get very large very quickly.  An external
> backing store avoids that problem by pushing it off to the viewer,
> and assuming that it is efficient about loading only the required
> elements.  A cross platform preview would be very nice, as long as
> it avoided that pitfall.

Sure, but this would be easy to accomplish if the printing interface was
based on per page callbacks, like:

void render_page_cb (cairo_t cr, int page_number)
{
  ...
}

The problem here is that for the application to know what to render for
each page it may need to do the "pagination", which sometimes involves
actually simulating rendering of all the previous pages, which can be a
performance problem.  This problem can be worked around, although it is
not easy on the programmer...

-- 
Gustavo J. A. M. Carneiro
<gjc inescporto pt> <gustavo users sourceforge net>
"The universe is always one step beyond logic" -- Frank Herbert



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