I am trying to use pdfViewer and am having an issue. Here is my traceback:
Traceback (most recent call last):
File “pdfviwer_test.py”, line 32, in
pdfV.viewer.LoadFile(’…/bd_xml_OL2.pdf’)
File “/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.9.4-osx_cocoa/wx/lib/pdfviewer/viewer.py”, line 169, in LoadFile
self.CalculateDimensions(True) # to get initial visible page range
File “/usr/local/Cellar/python/2.7.3/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-2.9.4-osx_cocoa/wx/lib/pdfviewer/viewer.py”, line 281, in CalculateDimensions
self.frompage = min(self.y0/self.Ypagepixels, self.numpages-1)
ZeroDivisionError: integer division or modulo by zero
My python script (which is really just taken from here http://wxpython.org/Phoenix/docs/html/lib.pdfviewer.html) and the pdf file are attached. The pdf is one page and generated by tikz with latex preview mode (so it is actually only a portion of a page).
From looking at the traceback, I assume self.Ypagepixel is zero. I don’t know how that happened or how to fix it.
Thanks,
Ryan
pdfviwer_test.py (1.17 KB)
bd_xml_OL2.pdf (16.8 KB)