42 Commits

Author SHA1 Message Date
Alexandre Detiste
0257f755cf remove most of Python2 compatibility code 2025-02-02 20:17:45 -05:00
Jorge Moraleda
2dc886a480 Refactor python only pdfviewer to support displaying pdf files where not all pages have the same size 2024-09-21 18:55:33 -04:00
Infernio
6dd4312d84 pdfviewer: Add support for pymupdf renaming
The 'fitz' module got renamed to 'pymupdf' in 1.24.3 Prepare for an
eventual deprecation and removal by importing from pymupdf first and
falling back to fitz only if that fails.

I also got rid of the other 'fitz'es in the file via 'fitz as pymupdf',
since pymupdf.open is much easier to read than fitz.open.
2024-09-13 21:20:19 +02:00
Jorge Moraleda
0cf08c27fd Explicitly convert float to int when calling to wx.Size in pure python pdfviewer 2023-10-27 18:45:16 -04:00
Infernio
aa4394773a Fix pdfViewer for Python 3.10
Needs ints instead of floats in these two places. Didn't notice any
others, but there may be more.
2022-09-01 14:57:56 +02:00
Infernio
2f6c469607 Support newer PyMuPDF versions
PyMuPDF 1.18 renamed all of its camelCase fields and methods to use
snake_case instead, and a later version (probably 1.19) removed the
deprecated aliases. This patch attempts to use the newer name first
(since most people will probably be using a newer version of PyMuPDF)
and falls back to the older name if that fails.
2022-07-08 15:22:46 +02:00
Jorge Moraleda
672ec886b8 Enable customization of layout of pdfviewer button panel 2021-11-21 18:11:14 -08:00
Metallicow
542a32c17d Optimize Colour Brush Pen
Use builtin Colours, Brushes, Pens where needed. They are faster.
2020-07-19 23:48:39 -05:00
Jorge Moraleda
d1f66f5513 Explicitly indicate that we don't want an alpha channel when rendering pdf pages
to account from the fact that the default on this parameter differs between
mupdf versions
2020-06-04 14:35:41 -07:00
Per A. Brodtkorb
426258b7b7 Adding missing close for open and replaced "fid=open(filename) fid.close()"
statements with the safer "with open(filename) as fid:" blocks.

Also removed unnecessary "try: ... finally: pass" statements
and refactored code from img2py function into _write_image and _replace_non_alphanumeric_with_underscore

Fixes #1574
2020-03-25 10:36:38 +01:00
Robin Dunn
99f4506929 Merge pull request #1516 from jmoraleda/bugfix1350
Fixes pdfviewer when using PyMuPDF version 1.15 or above. Fixes #1350
2020-02-18 14:48:57 -08:00
Jorge Moraleda
54b065f1fd Always perform full initialization of pdfViewer so that expected pdfViewer attributes always exist. Now, instead of performing a partial initialization, correctly handle the case where the containing window is still being initialized and is not reporting a correct client size. Fixes issue #1177 2020-02-17 18:00:02 -08:00
Jorge Moraleda
0e15258d96 Fixes pdfviewer when using PyMuPDF version 1.15 or above. Fixes #1350 2020-02-13 16:53:13 -08:00
Robin Dunn
7924b3b48d A few fixes from Jorge Moraleda 2019-05-31 21:21:06 -07:00
Metallicow
230bf5d6d3 Optimize All PNGs Nov2018
Since I had to fix a image issue and optimize it. I decided to rerun FileOptimizer 13.30.2393 over all pngs. Small bytes for some that had been optimized before, but this comit covers all pngs that may have been missed in the past. Maybe revisit running them all again in 2 years. Total time to process all pngs: approx 8 hours.
As technology improves this will only get better/faster when downloading, loading in browser, embedded, etc...
2018-11-13 16:08:12 -06:00
Robin Dunn
b1b0c9e297 wx.NewId() --> wx.ID_ANY or wx.Window.NewControlId() as appropriate 2018-06-19 10:31:56 -07:00
David Hughes
fa53686b32 Changed dead link and removed setting an obsolete attribute 2018-03-13 12:01:24 +00:00
Metallicow
99834ab3ec ⁉️ Trim trailing whitespace misc files
All these files seem like legit trailing whitespace that can be removed.
2018-01-16 09:37:04 -06:00
Metallicow
b713be1e89 Trim Whitespace pdfviewer directory 2016-10-12 22:43:41 -05:00
David Hughes
04a03c716a dcgraphics.py, bezier.py and vec2d.py no longer needed for rendering to printer DC
wx.GraphicsContext, Cairo.GraphicsContext and MuPDF page-Pixmap can now be
created directly in a printer DC in pdfviewer.py (unlike originally in 2009).
Cacheing of page bitmaps now removed - jerky scrolling no longer observed.
SetZoom modified to stay on the same page after scale changed.
2016-09-06 12:48:30 +01:00
David Hughes
4ca8c3e330 Disable ButtonPanel controls until PDF file chosen
Scale font metrics when rendering with Cairo (MSW only)
2016-08-24 17:52:35 -07:00
Robin Dunn
b4233d9299 Fully qualify names for more links. 2016-08-12 14:53:29 -07:00
David Hughes
a0436a3b6b Updated intra-doc links to ensure fully qualified names 2016-08-05 16:03:43 +01:00
David Hughes
56cad152d9 4 August 2016 Phoenix updates for wx.lib.pdfviewer and demo/PDFViewer
demo/viewer.py and viewer_basics.py removed - was demo of obsolete vtk
2016-08-04 11:26:08 +01:00
Robin Dunn
1d1fc7c187 More docstring ref fixes in wx.lib 2016-07-07 09:58:04 -07:00
Robin Dunn
cc3190e240 Lots more docstring refs fixed 2016-07-06 20:20:10 -07:00
Robin Dunn
ed4756b902 Remove wx.lib.six and use the stock six module instead,
and add it as an installation dependency.
2016-06-30 20:07:57 -07:00
Scott Talbert
64a3e46960 Fix pdfviewer for Python 3 2016-05-09 22:57:38 -04:00
Andrea Gavana
dca5ec90a7 Phoenix docs: fix pdfviewer docstrings to avoid Sphinx warnings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75856 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-02-09 13:27:18 +00:00
Robin Dunn
a9595b241a PR64: Various Phoenix and Py3 fixes for the demo and library
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75720 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-28 04:48:21 +00:00
Robin Dunn
700f95c632 PR 50: Py3 fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-14 03:09:16 +00:00
Robin Dunn
4f3de49192 PR 38 from Metallicow. Pen and Brush style updates
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-11 23:12:22 +00:00
Robin Dunn
6faf213a76 Change all <> to !=
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@75509 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-01-01 04:23:33 +00:00
Robin Dunn
9f24505715 Merge of PR 11 with the whitespace-only changes omitted.
See https://github.com/RobinD42/Phoenix/pull/11

Mostly phoenix-port changes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@74463 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-07-10 01:15:34 +00:00
Robin Dunn
87b3f4c01e More pdfviewer docstring patched from Werer
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73780 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-05 04:04:29 +00:00
Robin Dunn
60adbd7d7e More pdfviewer doc updates from Werner.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73776 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-04 01:47:27 +00:00
Robin Dunn
1324a74190 fix typo
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73771 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-03 02:11:56 +00:00
Robin Dunn
84713e54f4 Patch from Werner adding pdfviewer docstrings
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73766 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-04-02 03:57:29 +00:00
Andrea Gavana
80925c4e8c PDFViewer on Phoenix: slight reformatting of the docstrings (something more should be done...)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-03-30 20:21:45 +00:00
Robin Dunn
4efbe427fd bug fix from Werner
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73724 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-03-27 17:00:36 +00:00
Robin Dunn
af49fdf841 pdfviewer patches from Werner, Phoenix and doc updates.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73714 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2013-03-25 16:06:14 +00:00
Robin Dunn
247673201b Copy (branch) wx.lib, wx.py and wx.tools from Classic, and include subpackages branched from 3rdParty
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@72061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2012-07-13 01:36:07 +00:00