Skip to content

Releases: pypdfium2-team/pypdfium2

3.0.0b1

24 Sep 16:26
Compare
Choose a tag to compare
3.0.0b1 Pre-release
Pre-release

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 now None rather than -1, to avoid accidental reverse list indexing and to enforce that callers properly handle this case. Moreover, OutlineItem.is_closed is now None rather than False if the bookmark has no kids.
    • PdfPageObject.get_type() was replaced with a type attribute.
    • PdfPage.count_objects() was removed. Use PdfPage.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 to draw_annots
      • colour was renamed to fill_colour and now only takes a list of 4 values for simplicity - it may not be 3 values or None anymore
      • no_antialias has been replaced with separate boolean options no_smoothtext, no_smoothimage, and no_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 a PdfPage (uses FPDF_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, and memory_limit.
    • Added new render_to() functions to PdfPage and PdfDocument that take a custom bitmap converter, to transform the ctypes array to a different object. A set of built-in converters is provided with the BitmapConv 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 a prefer_la parameter to request automatic conversion of BGRA/RGBA to LA 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.
  • Setup code

    • $PYP_TARGET_PLATFORM was renamed to $PDFIUM_BINARY, the value sdist was renamed to none.
    • 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 to setup.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 in data/.
    • A MANIFEST.in file was added to avoid being dependent on setuptools_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.
pypdfium2 commit log

Commits between 2.11.0 and 3.0.0b1 (latest commit first):

  • 03b379f [autorelease] update changelog and version file
  • 75b972c update_pdfium: make max_workers configurable
  • 69a0b77 autorelease: nevermind, always include the log
  • 76fc08e Finalise changelog_staging
  • 21dc9b0 Misc improvements
  • b02b67b workflow: re-activate schedule
  • 0378257 Slightly improve converter docs
  • 6a24cc4 Revert "textpage: replace count_chars() with char_count attribute"
  • 7f2e9ff Update some docs
  • 18221b4 readme: suggest using get_functype()
  • 1b8d7f1 tocprinter: avoid some variable assignments
  • ff52551 Update tasks
  • 6d00654 Make most of _utils.py public
  • 2c82267 readme: fix use of non-public member
  • cc70047 utils: rename bg_colour to fill_colour
  • d960830 Rename back from color to colour
  • 69c780f rendering: rework colour integration
  • 26bf175 textpage: replace count_chars() with char_count attribute
  • 038feb2 Improve string decoding
  • 6b14960 docs: decide not to deprecate render_to* methods just yet
  • 97d2243 Update rendering CLI
  • fc736ec auto_bitmap_format(): flatten if/else tree
  • c44d81a multipage renderer: add missing close() calls
  • f8608e8 Set OutlineItem.is_closed to None if it has no kids
  • 1f2b75b toc/OutlineItem: Add n_kids attribute
  • 1093579 Provide means to plug in custom converters (#140)
  • e513026 render_topil: use frombuffer() rather than frombytes()
  • d17cffd autorelease: make commit log collapsible
  • 9d4a3fc autorelease: allow skipping commit log
  • 3df1533 autorelease: improve changelog handling f...
Read more

2.11.0

22 Aug 10:19
Compare
Choose a tag to compare

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

15 Aug 10:18
Compare
Choose a tag to compare

Release 2.10.0

Changes

Manual Summary

Git History

Commits between 2.9.0 and 2.10.0 (latest commit first):

  • 6c692d7 [autorelease] update changelog and version file

2.9.0

08 Aug 10:18
Compare
Choose a tag to compare

Release 2.9.0

Changes

Manual Summary

Git History

Commits between 2.8.0 and 2.9.0 (latest commit first):

  • 26ae6a1 [autorelease] update changelog and version file

2.8.0

02 Aug 16:37
Compare
Choose a tag to compare

Release 2.8.0

Changes

Manual Summary

Git History

Commits between 2.7.2 and 2.8.0 (latest commit first):

  • 9092870 [autorelease] update changelog and version file
  • 2ad3b1c Revert "Temporarily deactivate autorelease schedule"
  • be28101 Temporarily deactivate autorelease schedule
  • 9c72a32 autorelease: rename a function to a more expressive name
  • 82dfe85 changelog: add more information to 2.7.2

2.7.2

01 Aug 10:22
Compare
Choose a tag to compare

Release 2.7.2

Changes

Manual Summary

  • Added a new option rm_security to PdfDocument.save().
  • Added support for password-protected PDFs in the CLI subcommands merge, render, tile and toc.
  • 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 for do_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 to artefacts
  • 171b52f Rename craft_artifacts.py to craft_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

25 Jul 10:22
Compare
Choose a tag to compare

Release 2.7.1

Changes

Manual Summary

  • Improved release workflow.
  • Documentation corrections.
  • Enabled pinning of wheel and removed related warning filter in pyproject.toml.

2.6.0

18 Jul 10:26
Compare
Choose a tag to compare

Release 2.6.0

Changes

Manual Summary

  • Switched from FPDF_LoadMemDocument() to FPDF_LoadMemDocument64(). The latter uses size_t rather than int to avoid integer overflows on huge files.
  • Pinned ctypesgen to a more recent stable commit in pyproject.toml, as the release is fairly outdated. Suggested pinning of wheel by code comment.
  • Updated planned changes.

Git History

Commits between 2.5.0 and 2.6.0 (latest commit first):

  • 8b1f895 [autorelease] update changelog and version file
  • 782318e Switch to FPDF_LoadMemDocument64()
  • 761bbd4 Prepare changelog
  • 1d75946 Update planned changes
  • 451e776 Start listing ideas for API breaking changes
  • ded76a2 Partly re-enable dependency pinning

2.5.0

11 Jul 10:30
Compare
Choose a tag to compare

Release 2.5.0

Changes

Manual Summary

  • Wheels are now correctly flagged as impure, for they contain a binary extension.
  • Merged trigger.yaml into release.yaml workflow, and mk_releasenotes.py into autorelease.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

2.4.1

04 Jul 15:21
Compare
Choose a tag to compare

Release 2.4.1

Changes

Manual Summary

  • The manual summary of changes is now shown on the GitHub release page as well.

Git History

Commits between 2.4.0 and 2.4.1:

  • 9f98654 [autorelease] update changelog and version file
  • ccab399 Fix showing manual changelog on GH release page