I have an application where I create a graph that I need to be able to print
to postscript in order to collate it with some other postscript I generate.
On linux I was able to get this to work by going through the print framework
to print to a file without prompting the user. When I port this to windows
however, the print framework uses a wx.PrinterDC instead of the
wx.PostscriptDC so instead of postscript I get some unusable printer code.
I'm trying to just create my own wx.PostscriptDC and plot directly to that,
but I keep getting an error message complaining of an 'invalid postscript
dc'. Does anybody know how to either force windows to use the PostScriptDC,
or how to use a PostScriptDC directly?
Here is my attempt to use a PostscriptDC directly:
The wx.PostScriptDC requires that you call dc.StartDoc. That's where
it creates the output file (and assigns it to the m_pstream variable
you see mentioned in the exception message.) Call EndDoc when you are
done, to write the last bits to the file and close it.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!