[PythonReports-users] wx.lib.pdfviewer
Brought to you by:
a1s
From: Werner F. B. <wer...@fr...> - 2013-03-20 08:24:23
|
Hi Alex, Just an FYI. There was an issue with images not showing, which was fixed by David Hughes over the weekend - see attached. I use it from within my 'report manager' to allow to write a pdf and immediately preview it. from wx.lib.pdfviewer import pdfViewer, pdfButtonPanel class PDFViewer(sc.SizedFrame): def __init__(self, parent, **kwds): super(PDFViewer, self).__init__(parent, **kwds) contPane = self.GetContentsPane() self.buttonpanel = pdfButtonPanel(contPane, wx.NewId(), wx.DefaultPosition, wx.DefaultSize, 0) self.buttonpanel.SetSizerProps(expand=True) self.viewer = pdfViewer(contPane, wx.NewId(), wx.DefaultPosition, wx.DefaultSize, wx.HSCROLL|wx.VSCROLL|wx.SUNKEN_BORDER) self.viewer.SetSizerProps(expand=True, proportion=1) # introduce buttonpanel and viewer to each other self.buttonpanel.viewer = self.viewer self.viewer.buttonpanel = self.buttonpanel And then to use it I pass the file which was previously created by pdf.write: pdfV = PDFViewer(self.view) pdfV.viewer.LoadFile(_filename) pdfV.Show() Werner |