I can't figure out why in my app which is using wxPython 2.9.5.0.b20121231 this has an issue with showing the footer correctly.
I use it like this:
I am trying to reproduce your problem with the code you posted but having problems making a runnable example.
For example, what are sc.SizedFrame, self.GetContentsPane() and self.view?
Attached is a running sample, similar to my code and it shows the problem. I am attaching also a sample pdf which I used for testing, just change the line 39 according to where you placed the pdf file.
Thanks for looking at this whenever you find a moment.
Thanks, that's helped me nail it down. Like most bugs, its obvious after you have found it
When calculating all the dimensions of the page images to be rendered, I adjust the inter-page gap so the top-of-page to top-of-next page distance is an integral number of scroll increments of the display window and the displayed page number changes cleanly. One of the basic elements of this calculation is the client size of the scrolling window. When the window is inside a sized control, the first time is is asked, it is reporting a size of 16 x 16, presumably because it hasn't been sized properly yet. This results in an inter-page gap of minus 90. Unfortunately I wasn't resetting the gap at the start of each new calculation so this value persisted even after the window was correctly sized.
As you have already submitted a patch to wx.lib.pdfviewer.viewer.py in wxPython-dev, I'm not sure what version it would be best to create another patch against, so could I ask you to alter the following two lines in your own set of changes, please:
in pdfviewer.__init__
change
self.page_gap = 20 # nominal inter-page gap (points)
to
self.nom_page_gap = 20 # nominal inter-page gap (points)
Attached is a running sample, similar to my code and it shows the problem. I am attaching also a sample pdf which I used for testing, just change the line 39 according to where you placed the pdf file.
Attached is a running sample, similar to my code and it shows the problem. I am attaching also a sample pdf which I used for testing, just change the line 39 according to where you placed the pdf file.
Thanks, that's helped me nail it down. Like most bugs, its obvious after you have found it
Works great - thanks.
I'll submit another patch to the dev list, so Robin only needs to apply one of them - if that is o.k. with you.
Attached is the patch for pdfviewer.
- David's changes for the image not showing issue
- change USE_PRINTDIRECT to a Python property
- change SHOW_LOAD_PROGRESS to a Python property
- use pyPDF2 if present, otherwise pyPdf if neither is present raise
an import error
Will start to work on the Phoenix port over this weekend.
Werner
Subject:
Re: [wxPython-users] Re: wx.lib.pdfviewer - limitation
with images?
Date:
Thu, 21 Mar 2013 12:41:44 +0000
From:
David Hughes
Reply-To:
To: dfh@forestfield.co.ukwxpython-users@googlegroups.comwxpython-users@googlegroups.com
On 21/03/2013 11:35, Werner wrote:
> Are you following the wxPython-dev list? I will send the patch to there,
Yes I follow it.
> Would also like to change "USE_PRINTDIRECT", i.e. allow to set it at > run time.
Sounds a sensible idea. I assume you would change the hard coded DIRECTIVE into an attribute and provide a getter/setter for it. Would any of the other directives benefit from being settable do you think? Could you consider providing a patch and include your conditional importing of pyPdf/pyPDF2 as well?
-- Regards
David Hughes
Forestfield Software
-- You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to .
For more options, visit .
- David's changes for the image not showing issue
- change USE_PRINTDIRECT to a Python property
- change SHOW_LOAD_PROGRESS to a Python property
- use pyPDF2 if present, otherwise pyPdf if neither is present raise an import error
Will start to work on the Phoenix port over this weekend.
Werner
-------- Original Message --------
Subject: Re: [wxPython-users] Re: wx.lib.pdfviewer - limitation with images?
Date: Thu, 21 Mar 2013 12:41:44 +0000
From: David Hughes <dfh@forestfield.co.uk>
Reply-To: wxpython-users@googlegroups.com
To: wxpython-users@googlegroups.com
On 21/03/2013 11:35, Werner wrote:
> Are you following the wxPython-dev list? I will send the patch to there,
Yes I follow it.
> Would also like to change "USE_PRINTDIRECT", i.e. allow to set it at
> run time.
Sounds a sensible idea. I assume you would change the hard coded
DIRECTIVE into an attribute and provide a getter/setter for it. Would
any of the other directives benefit from being settable do you think?
Could you consider providing a patch and include your conditional
importing of pyPdf/pyPDF2 as well?
--
Regards
David Hughes
Forestfield Software
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email towxpython-users+unsubscribe@googlegroups.com.
For more options, visithttps://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "wxPython-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxPython-dev+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
It includes:
- David's changes for the image not showing issue
- change USE_PRINTDIRECT to a Python property
- change SHOW_LOAD_PROGRESS to a Python property
- use pyPDF2 if present, otherwise pyPdf if neither is present raise an import error
And David's latest change to ensure that footers show correctly.
It includes:
- David's changes for the image not showing issue
- change USE_PRINTDIRECT to a Python property
- change SHOW_LOAD_PROGRESS to a Python property
- use pyPDF2 if present, otherwise pyPdf if neither is present raise an
import error
And David's latest change to ensure that footers show correctly.