How to display a PostScript file in a Python GUI application
I would like to build a cross-platform GUI application in P开发者_如何学Pythonython 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.
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.
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.
精彩评论