Releases: pypdfium2-team/pypdfium2
Releases · pypdfium2-team/pypdfium2
3.0.0b1
Changes (Release 3.0.0b1)
Summary (pypdfium2)
-
Support model
API-breaking changes
- If the target page of a bookmark cannot be identified,
OutlineItem.page_index
is nowNone
rather than-1
, to avoid accidental reverse list indexing and to enforce that callers properly handle this case. Moreover,OutlineItem.is_closed
is nowNone
rather thanFalse
if the bookmark has no kids. PdfPageObject.get_type()
was replaced with atype
attribute.PdfPage.count_objects()
was removed. UsePdfPage.get_objects()
or the raw PDFium API instead.- If a negative index is passed to
PdfDocument.new_page()
, it is now interpreted in reversed direction, rather than inserting at the beginning. - PDFium is now provided with an external, python-allocated buffer for rendering. This has numerous advantages, most notably that callers don't need to free resources anymore.
PdfPage.render_base()
now directly returns a ctypes ubyte array;BitmapDataHolder
has been removed. - Changed rendering parameters
annotations
was renamed todraw_annots
colour
was renamed tofill_colour
and now only takes a list of 4 values for simplicity - it may not be 3 values orNone
anymoreno_antialias
has been replaced with separate boolean optionsno_smoothtext
,no_smoothimage
, andno_smoothpath
Other changes
OutlineItem
now contains information on the number of sub-items (n_kids
attribute).- All document-level methods that take a page index now accept negative values for reverse indexing (except the rendering methods).
- New method
PdfDocument.get_page_size()
to retrieve page size by index without needing to load aPdfPage
(usesFPDF_GetPageSizeByIndexF()
under the hood). - New rendering parameters added:
colour_scheme
,fill_to_stroke
,force_halftone
,draw_forms
,rev_byteorder
,prefer_bgrx
,force_bitmap_format
,extra_flags
,allocator
, andmemory_limit
. - Added new
render_to()
functions toPdfPage
andPdfDocument
that take a custom bitmap converter, to transform the ctypes array to a different object. A set of built-in converters is provided with theBitmapConv
class. Confer the updated API documentation for details. The previous rendering functions (render_topil()
render_tobytes()
, ...) are still around as aliases but might be deprecated eventually. - New rendering target
numpy_ndarray
added. - The
pil_image
rendering target now accepts aprefer_la
parameter to request automatic conversion ofBGRA
/RGBA
toLA
if rendering in greyscale mode with alpha channel. PdfPage.get_objects()
can now recursively descend into Form XObjects.- Form environments are now initialised/exited on document level rather than on page rendering. In the course of this work, a segmentation fault source was eliminated, related to a formerly undocumented requirement of PDFium regarding object lifetime. Whether the segmentation fault would actually take place was dependent on Python garbage collection behaviour. This did not appear to happen under normal circumstances, so the issue remained unnoticed for a long time.
- If the target page of a bookmark cannot be identified,
-
Setup code
$PYP_TARGET_PLATFORM
was renamed to$PDFIUM_BINARY
, the valuesdist
was renamed tonone
.- When doing an automatic release, repository changes are now only pushed after successful wheel building, to avoid leaving the repository in an invalid state in case some earlier step fails.
- pypdfium2 now declares a no-op setuptools extension to prevent wheel content from landing in a
purelib
folder. Some systems use this information to separate platform-dependent packages from pure-python packages (i. e./usr/lib64
instead of/usr/lib
). Confer PEP 427. - Autorelease now properly takes existing beta tags into account for its version changes.
- PDFium's commit log is now shown with GitHub releases.
- The wheel packaging script now restores in-tree artefacts from a possible editable install.
- Platform files are now detected in a more robust way. If missing, a proper exception will be raised.
- Platform data directories are now annotated with a text file storing the pdfium version, to prevent a possible mismatch between the state of
version.py
and the actual version of the used binary. The update and build scripts do not directly change the main version file anymore, but defer the changes tosetup.py
. - Missing platform files are now always procured implicitly on installation. If platform files exist already but are outdated, they will be updated by default. You may opt out by creating an empty file called
.lock_autoupdate.txt
indata/
. - A
MANIFEST.in
file was added to avoid being dependent onsetuptools_scm
. - On setup, dependency checks are now only done for system commands. The wonky implicit installation of missing Python packages was removed. If opting out of build isolation, callers should properly install setup dependencies beforehand.
-
Documentation
- Rewrote the project's
README.md
. Added more support model examples and an extensive guide regarding the raw PDFium/ctypes API. - Improved docstrings and included type hints.
- Rewrote the project's
pypdfium2 commit log
Commits between 2.11.0
and 3.0.0b1
(latest commit first):
03b379f
[autorelease] update changelog and version file75b972c
update_pdfium: make max_workers configurable69a0b77
autorelease: nevermind, always include the log76fc08e
Finalise changelog_staging21dc9b0
Misc improvementsb02b67b
workflow: re-activate schedule0378257
Slightly improve converter docs6a24cc4
Revert "textpage: replacecount_chars()
withchar_count
attribute"7f2e9ff
Update some docs18221b4
readme: suggest usingget_functype()
1b8d7f1
tocprinter: avoid some variable assignmentsff52551
Update tasks6d00654
Make most of_utils.py
public2c82267
readme: fix use of non-public membercc70047
utils: renamebg_colour
tofill_colour
d960830
Rename back fromcolor
tocolour
69c780f
rendering: rework colour integration26bf175
textpage: replacecount_chars()
withchar_count
attribute038feb2
Improve string decoding6b14960
docs: decide not to deprecaterender_to*
methods just yet97d2243
Update rendering CLIfc736ec
auto_bitmap_format(): flatten if/else treec44d81a
multipage renderer: add missing close() callsf8608e8
SetOutlineItem.is_closed
toNone
if it has no kids1f2b75b
toc/OutlineItem
: Addn_kids
attribute1093579
Provide means to plug in custom converters (#140)e513026
render_topil: use frombuffer() rather than frombytes()d17cffd
autorelease: make commit log collapsible9d4a3fc
autorelease: allow skipping commit log3df1533
autorelease: improve changelog handling f...
2.11.0
Release 2.11.0
Changes
Manual Summary
- Added a new function
PdfDocument.get_version()
to obtain the PDF version of a document.
Git History
Commits between 2.10.0
and 2.11.0
(latest commit first):
- 14c18a2 [autorelease] update changelog and version file
- 99e9078 Prepare changelog
- 564118b Declare
has_ext_modules
in a more official sort of way - 93f885d setup: prevent wheel content from landing in purelib folder
- e91c1c4 document/save: remove rm_security option again
- 962944d document: add new function get_version
- cb57b62 test_text: minor updates
- fec2ca0 autorelease: add TODOs
2.10.0
2.9.0
2.8.0
Release 2.8.0
Changes
Manual Summary
Git History
2.7.2
Release 2.7.2
Changes
Manual Summary
- Added a new option
rm_security
toPdfDocument.save()
. - Added support for password-protected PDFs in the CLI subcommands
merge
,render
,tile
andtoc
. - Corrected the release workflow to avoid incrementing minor version twice.
- Rewrote package building script with python.
- The stable branch is now always updated, even if it contains commits that are not in main.
- Various code style improvements.
Git History
Commits between 2.7.1
and 2.7.2
(latest commit first):
- 90728d1 [autorelease] update changelog and version file
- 50b8c5c Add a task
- 80565c8 autorelease: externalise
latest
fordo_versioning()
testing - e5ef13f autorelease: add safeguards to avoid inadvertent changes
- 8837a24 temporarily remove outdated version tests
- 4e01054 Improve version handling
- 04758e2 Update
build_pdfium
- 3e49a69 Rename
artifacts
toartefacts
- 171b52f Rename
craft_artifacts.py
tocraft_packages.py
- e44a010 Fix mistakes found by
make check
- 85d517f Make setup environment variable dynamic
- ede5f2f Pythonise package building
- a697ca5 Prepare changelog for next release
- ed58b22 Implement password option in remaining CLIs
- 6f96251 cli/render: implement
--passwords
flag similar to merge - 75d8e0b merge: do not unnecessarily pass
rm_security
- 8bf7c46 Update planned changes
- 28db2e7 cli/merge: improve code and add password parameter
- 15b9fa2 Allow for removing password-protection when saving
- 6a9b771 Add test case for opening non-encrypted PDF with password given
- 35681dc Update tasks / planned changes
- 7a3e1e4 Add note concerning macOS multi-version tags
- f68c9b6 Add a task
- a28e81b build: use minimal checkout configuration
- 29a8c3c closing: do not unnecessarily create lists
- 6af0b1c setup.py: remove excessive comment
- f24172a Make string style more consistent
- 47eaa3e autorelease: force-update stable branch
- b84b8f6 Fix workflow
- 85f7e3c Manually intervene in changelog
2.7.1
Release 2.7.1
Changes
Manual Summary
- Improved release workflow.
- Documentation corrections.
- Enabled pinning of
wheel
and removed related warning filter inpyproject.toml
.
2.6.0
Release 2.6.0
Changes
Manual Summary
- Switched from
FPDF_LoadMemDocument()
toFPDF_LoadMemDocument64()
. The latter usessize_t
rather thanint
to avoid integer overflows on huge files. - Pinned
ctypesgen
to a more recent stable commit inpyproject.toml
, as the release is fairly outdated. Suggested pinning ofwheel
by code comment. - Updated planned changes.
Git History
2.5.0
Release 2.5.0
Changes
Manual Summary
- Wheels are now correctly flagged as impure, for they contain a binary extension.
- Merged
trigger.yaml
intorelease.yaml
workflow, andmk_releasenotes.py
intoautorelease.py
, which significantly simplifies the code base. - Changed autorelease schedule from 12 to 10 o'clock UTC.
Git History
Commits between 2.4.1
and 2.5.0
(latest commit first):
- e38c149 [autorelease] update changelog and version file
- 204f1a9 Revert "pyproject: pin wheel and ctypesgen to specific commits"
- 43eada3 pyproject: pin wheel and ctypesgen to specific commits
- b2bdb5a changelog_staging: fix inversion
- 60a7ed0 Update changelog
- 504fe5e readme: remove fun facts section
- 56c6f54 setup_base: set
root_is_pure
to false - a012950 release.yaml: move a step
- 4e18bbd change autorelease schedule to 10 o'clock
- e6383da unlock push steps in autorelease script
- a1ba89c Merge release and autorelease workflows into one
- a8b922d colour_tohex: make order of definitions match return
- f87eb5c mk_releasenotes: add note regarding commit order
- 4904216 Remove left-over ChangelogStaging from autorelease script
- 1c485e9 [autorelease] clean up changelog_staging