I'm using pdfViewer (in wxPython Phoenix version 3.0.3.dev2323+9bcccff) and there is a bug that prevents the displayed PDF file from scrolling up or down.
There is a bug in the GoPage method of the pdfViewer class in viewer.py where it
does not call self.Render(). The code that reads:
if pagenum > 0 and pagenum <= self.numpages:
self.Scroll(0, pagenum*self.Ypagepixels/self.GetScrlPixelsPerUnit()[1])
else:
self.Scroll(0,0)
self.Render()
SHOULD BE:
if pagenum > 0 and pagenum <= self.numpages:
self.Scroll(0, pagenum*self.Ypagepixels/self.GetScrollPixelsPerUnit()[1])
else:
self.Scroll(0,0)
self.Render() # <-- Render() should be called outside the IF / ELSE block
(I don’t know the procedures for fixing the official source myself so am that since this change is so trivial someone else accustomed
to making such changes will take this on. Thanks)
self.Render() self.Scroll(0, 0) else: self.Render() self.Scroll(0, z) z = pagenum*y/x1 y = self.Ypagepixels x1 = x[1] x = self.GetScrollPixelsPerUnit() """ self.Scroll(0, pagenum*self.Ypagepixels/self.GetScrollPixelsPerUnit()[1]) """ RAS if pagenum > 0 and pagenum <= self.numpages: """ :param integer `pagenum`: go to the provided page number if it is valid Go to page """ def GoPage(self, pagenum):
I'm using pdfViewer (in wxPython Phoenix version 3.0.3.dev2323+9bcccff) and there is a bug that prevents the displayed PDF file from scrolling up or down.
There is a bug in the GoPage method of the pdfViewer class in viewer.py where it
does not call self.Render(). The code that reads:
if pagenum > 0 and pagenum <= self.numpages:
self.Scroll(0, pagenum*self.Ypagepixels/self.GetScrlPixelsPerUnit()[1])
else:
self.Scroll(0,0)
self.Render()
SHOULD BE:
if pagenum > 0 and pagenum <= self.numpages:
self.Scroll(0, pagenum*self.Ypagepixels/self.GetScrollPixelsPerUnit()[1])
else:
self.Scroll(0,0)
self.Render() # ← Render() should be called outside the IF / ELSE block
(I don’t know the procedures for fixing the official source myself so am that since this change is so trivial someone else accustomed
to making such changes will take this on. Thanks)
self.Render() self.Scroll(0, 0) else: self.Render() self.Scroll(0, z) z = pagenum*y/x1 y = self.Ypagepixels x1 = x[1] x = self.GetScrollPixelsPerUnit() """ self.Scroll(0, pagenum*self.Ypagepixels/self.GetScrollPixelsPerUnit()[1]) """ RAS if pagenum > 0 and pagenum <= self.numpages: """ :param integer `pagenum`: go to the provided page number if it is valid Go to page """ def GoPage(self, pagenum):
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
Various changes to viewer.py have been made for Python 3 by different people and this alteration to the indentation appeared somewhere along the line. It was originally a wxCallAfter() and it was there as a belt and braces that seemed to be needed by Windows 8 which, for some reason, didn’t respect the main call to Render() that’s made in the OnScroll handler.
If you mean that the display doesn’t scroll in response to the corresponding buttons in the button bar, no it doesn’t at the moment. This is a Python 3 issue connected to the changes to integer division.
As the original author of pdfViewer, I am currently working through the changes needed to make things work under Phoenix with both Python 2 and 3. I’m in the process of testing everything under Windows and OS X and hope to issue a Pull Request soon asking Robin to commit the changes.
I'm using pdfViewer (in wxPython Phoenix version 3.0.3.dev2323+9bcccff) and there is a bug that prevents the displayed PDF file from scrolling up or down.
There is a bug in the GoPage method of the pdfViewer class in viewer.py where it
does not call self.Render(). The code that reads:
if pagenum > 0 and pagenum <= self.numpages:
self.Scroll(0, pagenum*self.Ypagepixels/self.GetScrlPixelsPerUnit()[1])
else:
self.Scroll(0,0)
self.Render()
SHOULD BE:
if pagenum > 0 and pagenum <= self.numpages:
self.Scroll(0, pagenum*self.Ypagepixels/self.GetScrollPixelsPerUnit()[1])
else:
self.Scroll(0,0)
self.Render() # ← Render() should be called outside the IF / ELSE block