PDFWindow problems with Acrobat 5 & 7

Hello all,

I'm having some rather interesting (read: frustrating) problems with wx.lib.pdfwin.PDFWindow, on XP SP2.

With Acrobat 5 (5.1 actually), the control sometimes fails to display after three or four calls of the class (open the frame, close the frame, times 4), at which time I have to close the whole app and restart it. The class loads correctly, I can call LoadFile(), I can call setShowToolbar(), but the whole area of the control is just blank.

With Acrobat 7, the app simply crashes when I try to load a file. No exception thrown, nothing.

I completely clean (registry keys and all) each Acrobat when I switch versions.

I just tried with Acrobat 6 and it seems to work, for now. But the app will be deployed on about 50 clients running a lot of different versions of Windows including Win98/Win98SE, which requires no more than Acrobat 5... and that's without mentionning Acrobat 6's nasty reputation...

Does anyone knows what's going on? I've done some googling, and it seems that Acrobat 7 changed some of its API; does anyone know if PDFWindow can handle Acrobat 7 specifically? (that wouldn't explain my Acrobat 5 problem, but that would be a start)

Alternatively, is it possible to use something else than Acrobat to display PDFs? Ghostview or something? Every other PDF activex control I've found are commercial, so I can't play with them...

Some code background:

The PDF class belongs to a wx.Frame (PDFdlg) called with a button from the main app window. This frame is really simple, since the whole point was to just display a PDF file (an earlier version of the app called the whole Acrobat Reader, but then the user had the ability to easily 'save as' the file, which was not desirable).

About the whole code for the frame consists of:

class PDFdlg(wx.Frame):
  def __init__(self, parent, filename):

    width, height=wx.GetDisplaySize()
    wx.Frame.__init__(self, parent, -1, titre, pos=wx.DefaultPosition, size=(width-(width/5), height-(height/10)))

    self.pdf = PDFWindow(self, style=wx.SUNKEN_BORDER)
        
    self.pdf.LoadFile(filename)
    self.pdf.setShowToolbar(False)

minus some stuff for the frame's toolbar and giving the frame a proper title.

The code itself obviously works, since Acrobat 5 can display a file without problem; at least until the frame is called for the fourth time or so. After that, the frame still displays but the PDF control is blank and acrord32.exe doesn't seem to load. Acrobat 7 doesn't care which file is wanted; it crashes every time I try a LoadFile(). I didn't try putting setShowToolbar() first, though, I'll do that and see what happens...

Regards,

Nicolas Briche

···

--

"If you try to stay sane in life, it'll just
drive you crazy. So, you may as well go crazy
now and have fun with life."
--MegaZone