1

I would like to build a cross-platform GUI application in Python that displays PostScript files I generate, among some other stuff. What is the best way to accomplish this? Ideally I would be able to do things like zoom and pan the displayed graphic.

Do any/some/all of the GUI toolkits have something I can drop in to do this, and if so what are they called and how do they work? If necessary, I can convert the postscript file to PDF or a raster format behind the scenes, but I'd rather not do the latter.

Mike Graham
  • 73,987
  • 14
  • 101
  • 130

2 Answers2

1

I asked pretty much the same question a little time ago. Here it is. Hope it helps.

Note: Poppler is highly undocumented. If you use Gtk for your GUI there are a few working examples. In Qt things are a little harder, and I haven't figured out a way myself yet.

Community
  • 1
  • 1
japs
  • 1,286
  • 13
  • 27
  • Thanks for the input and link. Before posting this I tried to look for information on using poppler and hoped that someone could point out a good example or documentation to help with doing what I want to. I am kind of surprised I cannot find a drop-in solution for this, even at the C level. – Mike Graham Mar 29 '10 at 20:07
  • The surprise is mutual, in fact I started a new question asking for examples, which you can find at the following url: http://stackoverflow.com/questions/2507498/have-you-got-a-py-poppler-qt-example . The latter also links to the only two examples I found so far in the net. – japs Mar 30 '10 at 16:31
1

In a word Ghostscript. It's been a while since I used it, but it's cross-platform and you can use it to generate image files which your app could then display, pan, and zoom. I used it to develop and test some pretty involved commercial Postscript code for my own products and under contract for others. It's open source, which came in handy for a couple of use cases I had. Nowdays I believe it does PDF, too.

martineau
  • 119,623
  • 25
  • 170
  • 301