[pygtk] Display PostScript files in PyGTK without conversion?

Chris Cole ccole2 at mix.wvu.edu
Wed Nov 7 10:52:40 WST 2007


Donn wrote:
>> however I would need a way
>> to display PostScript files.
> 
> I hear that Cairo (pyCairo) can do stuff with postscript as well as pdf. You 
> should def. play around with it.

You're right cairo does do some stuff with postscript and pdf but I'm 
running into the same problem. After a little searching I know you can 
something like:

 >>> import cairo
 >>> surface = cairo.PDFSurface('foo.pdf', 300, 600)
 >>> context = cairo.Context(surface)
 >>>

but I'm not really sure how to display a cairo context or surface inside
gtk. I'm guessing you have to use a gtk.DrawingArea or something like 
that but I haven't been able to figure it out...

Any help would be greatly appreciated.

Thanks,
   Chris


More information about the pygtk mailing list