Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: py-pdf/pypdf
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6.8.0
Choose a base ref
...
head repository: py-pdf/pypdf
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6.9.0
Choose a head ref
  • 6 commits
  • 16 files changed
  • 4 contributors

Commits on Mar 10, 2026

  1. BUG: Avoid accessing invalid page when inserting blank page under som…

    …e conditions (#3529)
    
    width and height are now treated symmetrically, and updated only if they
    are not provided.
    
    ---------
    
    Co-authored-by: Stefan <96178532+stefan6419846@users.noreply.github.com>
    j-t-1 and stefan6419846 authored Mar 10, 2026
    Configuration menu
    Copy the full SHA
    2cfcd7e View commit details
    Browse the repository at this point in the history

Commits on Mar 11, 2026

  1. PI: Batch-parse all objects in ObjStm on first access (#3677)

    On first access to any object in a compressed object stream,
    parse and cache ALL objects in that stream in one pass.
    This avoids O(N²) behavior when many objects from the same
    stream are resolved individually during add_page().
    
    PDFs produced by DMS tools like PDFKit.NET DMV10 pack ~2000
    objects into a single ObjStm. The previous code scanned the
    full header for each lookup, resulting in ~77M function calls
    and 5s+ parse times for a 370KB invoice. With batch parsing,
    the same file completes in ~0.08s (61x speedup).
    dmitry-kostin authored Mar 11, 2026
    Configuration menu
    Copy the full SHA
    cf2e518 View commit details
    Browse the repository at this point in the history

Commits on Mar 12, 2026

  1. PI: Fix O(n²) performance in NameObject read/write (#3679)

    Three functions had quadratic behavior that caused hangs on PDFs with
    extremely long Name objects (e.g. repeatedly mis-encoded UTF-8 names):
    
    - read_until_regex: searched entire accumulated buffer on each 16-byte
      chunk instead of only the new chunk, and used bytes concatenation
    - NameObject.unnumber: rebuilt entire bytes object on each # replacement
    - NameObject.renumber: used out += concatenation in a loop
    dmitry-kostin authored Mar 12, 2026
    Configuration menu
    Copy the full SHA
    3a4e913 View commit details
    Browse the repository at this point in the history
  2. ENH: Expose /Perms verification result on Encryption object (#3672)

    Add `perms_valid` attribute to the `Encryption` class that stores the
    result of `AlgV5.verify_perms()`. This allows callers to detect when the
    `/Perms` integrity check fails for AES-256 encrypted documents (R5/R6),
    indicating that the `/P` permissions field may have been tampered with.
    
    Previously, a failed `/Perms` check only logged a warning with no
    programmatic way to detect it.
    
    Closes #3657.
    costajohnt authored Mar 12, 2026
    Configuration menu
    Copy the full SHA
    a3451e8 View commit details
    Browse the repository at this point in the history
  3. BUG: Avoid sharing array-based content streams between pages (#3681)

    Otherwise, applying a transformation to one of the pages renders all
    pages referencing the shared objects invalid due to
    `PageObject.replace_contents` setting them to a `NullObject` without
    being able to reliable check for further usages.
    
    Closes #3680.
    stefan6419846 authored Mar 12, 2026
    Configuration menu
    Copy the full SHA
    5a9a0da View commit details
    Browse the repository at this point in the history

Commits on Mar 15, 2026

  1. REL: 6.9.0

    ## What's new
    
    ### New Features (ENH)
    - Expose /Perms verification result on Encryption object (#3672) by @costajohnt
    
    ### Performance Improvements (PI)
    - Fix O(n²) performance in NameObject read/write (#3679) by @dmitry-kostin
    - Batch-parse all objects in ObjStm on first access (#3677) by @dmitry-kostin
    
    ### Bug Fixes (BUG)
    - Avoid sharing array-based content streams between pages (#3681) by @stefan6419846
    - Avoid accessing invalid page when inserting blank page under some conditions (#3529) by @j-t-1
    
    [Full Changelog](6.8.0...6.9.0)
    stefan6419846 committed Mar 15, 2026
    Configuration menu
    Copy the full SHA
    8f1f4aa View commit details
    Browse the repository at this point in the history
Loading