Re: [Gnome-print] Tutorial? API Reference?



Hello!

On 06 Feb 2001 23:49:21 -0700, Andrej Andrejko wrote:
> I think I can implement what I need from the test-print program included with the
> gnome-print libraries.  I have one other question, how do determine the dpi of the
> output page?  In particular I need to render a large RGB buffer so that it appears on
> the page as the correct size.  I know the dpi of the buffer and I need to use
> gnome_print_rgbimage() to render the output on the page at the correct size.

You cannot :(
This is well-known limitation, but cannot be resolved easily before gnome-print will
include full-featured configuration framework. The same limitation exists in fake
RGBA printing on PostScript (you do not know exact output resolution, so you cannot
fine-tune the generated bitmaps to it). The best thing you can do, is to use some
reasonable default value, like 200dpi for full-color and 600dpi for black/white
images.
But to print buffer 1:1 you do not need output resolution at all. Raster images are
always printed into 0,0 1,1 square in user coordinates, so you have to do something
like (I use fake PostScript notation here - porting it to gnome-print is trivial). I also
expect, that you are using "normal" buffer - i.e. the one that has 0,0 in top left.

gsave
$req_top_left_x $req_top_left_y translate
$req_width -$req_height scale
... rgbaimage
grestore

Best wishes,
Lauris

 
> 
> Thanks,
> Andrej
> 
> 
> On Tue, Feb 06, 2001 at 04:00:59PM +0200, Lauris Kaplinski wrote:
> > Hello!
> > 
> > AFAIK there is no tutorial available.
> > If you know PostScript basics, you need only little more. Most gnome-print methods
> > are functionally identical to PostScript operators.
> > Things that you need in addition:
> > 1. Create GnomePrintContext initially, Use GnomePrintDialog, get GnomePrinter and
> > create GnomePrintContext with gnome_print_context_new. Or use GnomePrintMaster
> > if you need reasonable handling of multiple copies.
> > 2. GnomeFont for text - use GnomeFontDialog and/or gnome_font_new_closest.
> > 3. gnome_print_show accepts UTF8 encoded text - if your application uses some
> > other encoding internally, you have to transcode manually.
> > 4. Every page has to start with gnome_print_beginpage and end with gnome_print_showpage
> > 
> > There shouldn't be any limitations to job size. Currently most jobs are sent
> > directly to lpr or written to file, so gnome-print even does not have to handle these.
> > Exception is print preview and some other contexts, that have to use in-memory
> > representations. There is no artifical limits, but, of course, print preview
> > may become slow with VERY complex page layouts.
> > 
> > Btw. many things will change for gnome 2.0, but that's future.
> > 
> > Lauris
> > 
> > On 05 Feb 2001 23:49:43 -0700, Andrej Andrejko wrote:
> > > Hi.
> > > 
> > > Can anyone point me to a reference on using gnome-print?  I was unable to find any
> > > documentation on developer.gnome.org/doc/.  
> > > 
> > > Is gnome-print capable of handling large print jobs?  (on the order of 800 mb?)
> > > 
> > > Thanks,
> > > Andrej
> > > 
> > > _______________________________________________
> > > Gnome-print maillist  -  Gnome-print@helixcode.com
> > > http://lists.helixcode.com/mailman/listinfo/gnome-print
> > 
> 
> _______________________________________________
> Gnome-print maillist  -  Gnome-print@helixcode.com
> http://lists.helixcode.com/mailman/listinfo/gnome-print





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