Up to [cvs.NetBSD.org] / pkgsrc / textproc / py-pdf
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
py-pdf: update to 6.20.0.
Security (SEC)
Limit work per stream (filter count, accumulated decoding work) (#4173) by @stefan6419846
New Features (ENH)
Add support for BrotliDecode filter (PDF 2.0) (#4168) by @stefan6419846
Performance Improvements (PI)
Parse an embedded CFF font program once per stream (#4164) by @marshalltech81
Parse numbers, indirect references, names and nulls faster (#4148) by @MartinThoma
Do not inherit PdfObject from a Protocol (#4149) by @MartinThoma
Speed up cloning direct objects (#4152) by @MartinThoma
Bug Fixes (BUG)
Report the correct page number for identical pages (#4154) by @pasmud
Decrypt the XMP metadata stream unless /EncryptMetadata is false (#4151) by @metsw24-max
Robustness (ROB)
Multiple changes by @RavSinghChandan
Accept an %%EOF marker that is not at the start of a line (#4136) by @Dmao233
Font / _cmapy.py: More robust guards around fontTools (#4157) by @PJBrs
Flatten the page tree iteratively (#4107) by @MartinThoma
Ignore invalid character codes for TrueType and Type1 font widths (#4117) by @stefan6419846
Restrict values to allowed range in CCITTFaxDecode (#4115) by @stefan6419846
Drop a /Kids entry resolving to null instead of raising a cycle error (#4108) by @MartinThoma
Developer Experience (DEV)
Declare official support for Python 3.15 by @stefan6419846
Declare protocol data members on PdfReader and PdfWriter (#4106) by @ihsandeniz
py-pdf: updated to 6.18.0 6.18.0, 2026-09-07 Security (SEC) - Limit allowed length of indirect object tokens Deprecations (DEP) - Rework configuration value handling New Features (ENH) - Draw borders and backgrounds for appearance streams and annotations
py-pdf: update to 6.15.0. ## Version 6.15.0, 2026-08-06 ### Security (SEC) - Improve performance of read_until_whitespace (#3947) - Limit CID width range and width count when loading fonts (#3946) - Limit token length for ToUnicode entries (#3944) ### Deprecations (DEP) - Deprecate previously missed inline_images setter as well (#3897) ### New Features (ENH) - Add ActualText tag when we produce RTL appearance stream (#3901) - Allow keeping original PDF header in non-incremental clone mode (#3918) - AppearanceStream: Add support for RTL appearance streams with Arabic characters (#3831) - Add actions base class (#3552) ### Bug Fixes (BUG) - Expand low-bit samples for images without a filter (#3938) - Decode low-bit DeviceRGB images as RGB instead of palette (#3929) - Correctly handle IndirectObject in FlateDecode.decode DecodeParms (#3937) ### Documentation (DOC) - Image and attachment filenames are unsanitized (#3942) ### Maintenance (MAINT) - Update charset mappings (#3935)
py-pdf: updated to 6.8.0 6.8.0, 2026-03-09 Security (SEC) - Limit allowed `/Length` value of stream New Features (ENH) - Add /IRT (in-reply-to) support for markup annotations Documentation (DOC) - Avoid using `PageObject.replace_contents` on PdfReader - Document how to disable jbig2dec calls
py-pdf: updated to 6.7.0 Version 6.7.0, 2026-02-08 Deprecations (DEP) - Deprecate support for abbreviations in decode_stream_data New Features (ENH) - Add ability to add font resources for 14 Adobe Core fonts in text widget annotations Bug Fixes (BUG) - Avoid invalid load for ICCBased FlateDecode images in mode 1 Robustness (ROB) - Fix AESV2 decryption when /Length missing in encrypt dict - Fix merging when annotations point to NullObject - Check for `self._info` being None in `compress_identical_objects`
py-pdf: update PLIST for 6.6.0
py-pdf: updated to 6.4.1 6.4.1, 2025-12-07 Performance Improvements (PI) - Optimize loop for layout mode text extraction Bug Fixes (BUG) - Do not fail on choice field without /Opt key Documentation (DOC) - Document possible issues with merge_page and clipping - Add some notes about library security Maintenance (MAINT) - Use CORE_FONT_METRICS for widths where possible
py-pdf: updated to 6.2.0 6.2.0 New Features (ENH) - Add 'strict' parameter to PDFWriter Bug Fixes (BUG) - PdfWriter.append fails when there are articles being None Documentation (DOC) - Execute docs examples in CI
py-pdf: update to 6.1.1. ## Version 6.1.1, 2025-09-28 ### Bug Fixes (BUG) - Insert new embedded files in a sorted manner (#3477) - Fix name tree handling for embedded files with Kids-based inputs (#3475) - Make embedding files not break PDF/A-3 compliance (#3472) ### Documentation (DOC) - Document AFRelationship handling for PDF/A and provide constants (#3478) ## Version 6.1.0, 2025-09-21 ### New Features (ENH) - Enhance XMP metadata handling with creation and setter methods (#3410) - Add all font metrics for base 14 Type 1 PDF fonts (#3363) - Allow deleting embedded files (#3461) - Add support for Python in FIPS mode for document identifier (#3438) ### Bug Fixes (BUG) - Fix handling of UTF-16 encoded destination titles (#3463) - Guard empty input to prevent IndexError (#3448) ### Developer Experience (DEV) - Fix type hint for XMP metadata setter to add bytes type (#3464)
py-pdf: update to 6.0.0.
Security (SEC)
Limit decompressed size for FlateDecode filter (#3430) by @stefan6419846
Deprecations (DEP)
Drop Python 3.8 support (#3412) by @stefan6419846
New Features (ENH)
Move BlackIs1 functionality to tiff_header (#3421) by @j-t-1
Robustness (ROB)
Skip Go-To actions without a destination (#3420) by @badGarnet
Developer Experience (DEV)
Update code style related libraries (#3414) by @stefan6419846
Update mypy to 1.17.0 (#3413) by @stefan6419846
Stop testing on Python 3.8 and start testing on Python 3.14 (#3411) by @stefan6419846
Maintenance (MAINT)
Cleanup deprecations (#3424) by @stefan6419846
py-pdf: update to 5.9.0.
New Features (ENH)
Automatically preserve links in added pages (#3298) by @larsga
Allow writing/updating all properties of an embedded file (#3374) by @Arya-A-Nair
Bug Fixes (BUG)
Fix XMP handling dropping indirect references (#3392) by @stefan6419846
Robustness (ROB)
Deal with DecodeParms being empty list (#3388) by @stefan6419846
Documentation (DOC)
Document how to read and modify XMP metadata (#3383) by @stefan6419846
py-pdf: update to 5.8.0.
New Features (ENH)
Implement flattening for writer (#3312) by @PJBrs
Bug Fixes (BUG)
Unterminated object when using PdfWriter with incremental=True (#3345) by @m32
Robustness (ROB)
Resolve some image extraction edge cases (#3371) by @stefan6419846
Ignore faulty trailing newline during RLE decoding (#3355) by @henningkoertelgmg
Gracefully handle odd-length strings in parse_bfchar (#3348) by @stefan6419846
Developer Experience (DEV)
Modernize license specifiers (#3338) by @stefan6419846
Maintenance (MAINT)
Reduce max-complexity of tool.ruff.lint.mccabe (#3365) by @j-t-1
Refactor text extraction code by @MartinThoma
py-pdf: adapt for flit_core 3.11. Bump PKGREVISION.
py-pdf: updated to 5.3.0 Version 5.3.0, 2025-02-09 New Features (ENH) - Handle attachments in /Kids and provide object-oriented API Bug Fixes (BUG) - Handle annotations being None on merging Robustness (ROB) - Prevent excessive layout mode text output from Type3 fonts Documentation (DOC) - stefan6419846 becomes BDFL of pypdf - Tidy the visitor function description Developer Experience (DEV) - Remove ignoring multiple Ruff rules - Remove unused mutmut configuration Testing (TST) - Fix warning assertions to use `pytest.warns()`
py-pdf: update to 5.1.0. ## Version 5.1.0, 2024-10-27 ### New Features (ENH) - Add `layout_mode_font_height_weight` argument to `PageObject.extract_text()` (#2920) ### Bug Fixes (BUG) - Fix font specificier for FreeText annotation (#2893) - Line breaks are not generated due to incorrect calculation of text leading (#2890) - Improve handling of spaces in text extraction (#2882) ### Robustness (ROB) - Soft failure for flate encode image mode 1 with wrong LUT size (#2900) ### Documentation (DOC) - Use latest package versions (#2907) - Correct example of reading FileAttachment annotation (#2906) ### Developer Experience (DEV) - Update pinned requirements (#2918) - Make make_release.py compatible with Windows environment (#2894) ### Maintenance (MAINT) - Remove references to outdated Python versions (#2919) - Generalize the method of obtaining space_code (#2891) - Unnecessary character mapping process (#2888) - New LZW decoding implementation (#2887) ### Testing (TST) - Add LzwCodec for encoding (#2883) ### Code Style (STY) - Capitalize error messages (#2903) - Modify error messages in PdfWriter (#2902)
py-pdf: updated to 4.3.0 Version 4.3.0, 2024-06-23 New Features (ENH) - Accept ETen-B5 and UniCNS-UTF16 encodings - Add decode_as_image() to ContentStreams - context manager for PdfReader - Add capability to set font and size in fields - Allow to pass input file without named argument Bug Fixes (BUG) - Fix deprecation for Ressources when using old constants - Fix images issue 4 bits encoding and LUT starting with UTF16_BOM - Reading large compressed images takes huge time to process - Highlighted Text Cannot Be Printed - Fix UnboundLocalError on malformed pdf Robustness (ROB) - Cope with missing Standard 14 fonts in fields - Improve inline image extraction - Cope with loops in Fields tree - Discard /I in choice fields for compatibility with Acrobat - Cope with some issues in pillow - Cope with some image extraction issues Documentation (DOC) - Various improvements on docstrings and examples Maintenance (MAINT) - Deprecate interiour_color with replacement interior_color - Add deprecate_with_replacement to PdfWriter.find_bookmark Code Style (STY) - Change Link to be a non-markup annotation
py-pdf: updated to 4.2.0 Version 4.2.0, 2024-04-07 New Features (ENH) - Allow multiple charsets for NameObject.read_from_stream - Add support for /Kids in page labels - Allow to update fields on many pages - Tolerate PDF with invalid xref pointed objects - Add Enforce from PDF2.0 in viewer_preferences - Add += and -= operators to ArrayObject Bug Fixes (BUG) - Fix merge_page sometimes generating unknown operator 'QQ' - Fix fields update where annotations are kids of field - Process CMYK images without a filter correctly - Extract text in layout mode without finding resources - Prevent recursive loop in some PDF files Robustness (ROB) - Tolerate "truncated" xref - Replace error by warning for EOD in RunLengthDecode/ASCIIHexDecode - Rebuild xref table if one entry is invalid - Robustify stream extraction Documentation (DOC) - Update release process for latest changes - Encryption/decryption: Clone document instead of copying all pages - Minor improvements - Update annotation list - Update references and formatting - Correct threads reference, plus minor changes - Minor readability increases - Simplify PaperSize examples - Minor improvements Developer Experience (DEV) - Remove unused dependencies - Remove page labels PR link from message - Fix changelog generator regarding whitespace and handling of "Other" group - Add REL to known PR prefixes - Release using the REL commit instead of git tag - Unify code between PdfReader and PdfWriter - Bump softprops/action-gh-release from 1 to 2 Maintenance (MAINT) - Ressources → Resources (and internal name childs) - Fix typos found by codespell - Update Read the Docs configuration - Add root_object, _info and _ID to PdfReader Testing (TST) - Allow loading truncated images if required - Fix download issues from - Improve test_get_contents_from_nullobject to show real use-case - Add missing test annotations
py-pdf: update to 4.0.0. ## Version 4.0.0, 2024-01-19 ### Deprecations (DEP) - Drop Python 3.6 support (#2369) - Remove deprecated code (#2367) - Remove deprecated XMP properties (#2386) ### New Features (ENH) - Add "layout" mode for text extraction (#2388) - Add Jupyter Notebook integration for PdfReader (#2375) - Improve/rewrite PDF permission retrieval (#2400) ### Bug Fixes (BUG) - PdfWriter.add_uri was setting the wrong type (#2406) - Add support for GBK2K cmaps (#2385) ### Maintenance (MAINT) - Return None instead of -1 when page is not attached (#2376) - Complete FileSpecificationDictionaryEntries constants (#2416) - Replace warning with logging.error (#2377)
py-pdf: update to 3.17.0. ## Version 3.17.0, 2023-10-29 ### Security (SEC) - Infinite recursion when using PdfWriter(clone_from=reader) (#2264) ### New Features (ENH) - Add parameter to select images to be removed (#2214) ### Bug Fixes (BUG) - Correctly handle image mode 1 with FlateDecode (#2249) - Error when filling a value with parentheses #2268 (#2269) - Handle empty root outline (#2239) ## Version 3.16.4, 2023-10-10 ### Bug Fixes (BUG) - Avoid exceeding recursion depth when retrieving image mode (#2251) ## Version 3.16.3, 2023-10-08 ### Bug Fixes (BUG) - Invalid cm/tm in visitor functions (#2206) - Encrypt / decrypt Stream object dictionaries (#2228) - Support nested color spaces for the /DeviceN color space (#2241) - Images property fails if NullObject in list (#2215) ### Developer Experience (DEV) - Unify mypy options and warn redundant workarounds (#2223) ## Version 3.16.2, 2023-09-24 ### Bug Fixes (BUG) - PDF size increases because of too high float writing precision (#2213) - Fix test_watermarking_reportlab_rendering() (#2203) ## Version 3.16.1, 2023-09-17 ⚠️ The 'rename PdfWriter.create_viewer_preference to PdfWriter.create_viewer_preferences (#2190)' could be a breaking change for you, if you use it. As it was only introduced last week I'm confident enough that nobody will be affected though. Hence only the patch update. ### Bug Fixes (BUG) - Missing new line in extract_text with cm operations (#2142) - _get_fonts not processing properly CIDFonts and annotations (#2194) ### Maintenance (MAINT) - Rename PdfWriter.create_viewer_preference to PdfWriter.create_viewer_preferences (#2190) ## Version 3.16.0, 2023-09-10 ### Security (SEC) - Infinite recursion caused by IndirectObject clone (#2156) ### New Features (ENH) - Ease access to ViewerPreferences (#2144) ### Bug Fixes (BUG) - Catch the case where w[0] is an IndirectObject instead of an int (#2154) - Cope with indirect objects in filters and remove deprecated code (#2177) - Accept tabs in cmaps (#2174) / cope with extra space (#2151) - Merge pages without resources (#2150) - getcontents() shall return None if contents is NullObject (#2161) - Fix conversion from 1 to LA (#2175) ### Robustness (ROB) - Accept XYZ with no arguments (#2178)
python/wheel.mk: simplify a lot, and switch to 'installer' for installation This follows the recommended bootstrap method (flit_core, build, installer). However, installer installs different files than pip, so update PLISTs for all packages using wheel.mk and bump their PKGREVISIONs.
py-pdf: updated to 3.14.0 Version 3.14.0, 2023-07-29 New Features (ENH) - Accelerate image list keys generation - Use `cryptography` for encryption/decryption as a fallback for PyCryptodome - Extract LaTeX characters - ASCIIHexDecode.decode now returns bytes instead of str Bug Fixes (BUG) - Add RunLengthDecode filter - Process /Separation ColorSpace - Handle single element ColorSpace list - Process lookup decoded as TextStringObjects Robustness (ROB) - Cope with garbage collector during cloning Maintenance (MAINT) - Cleanup of annotations Version 3.13.0, 2023-07-23 New Features (ENH) - Add is_open in outlines in PdfReader and PdfWriter Bug Fixes (BUG) - Search /DA in hierarchy fields - Cope with different ISO date length - Decode Black only/CMYK deviceN images - Process CMYK in deflate images Developer Experience (DEV) - Add mypy to pre-commit - Release automation
py-pdf: update to 3.12.0.
3.12.0
What's Changed
We finally fully support modern cryptography for encrypting and decrypting PDF files.
A big thank you to @exiledkingcc who did this work a while a go 🙏
New Features (ENH)
Add AES support for encrypting PDF files (#1918, #1935, #1936, #1938) by @exiledkingcc
Add page deletion feature to PdfWriter (#1843) by @pubpub-zz
Bug Fixes (BUG)
PdfReader.get_fields() attempts to delete non-existing index "/Off" (#1933) by @dmjohnsson23
Remove unused objects when cloning_from (#1926) by @pubpub-zz
Add the TK.SIZE into the trailer (#1911) by @talcher
add_named_destination() maintains named destination list sort order (#1930) by @robertkearns
3.11.1
Bug Fixes (BUG)
Cascaded filters in image objects (#1913) by @pubpub-zz
Append pdf with named destination using numbers for pages (#1858) by @pubpub-zz
Ignore "/B" fields only on pages in PdfWriter.append() (#1875) by @pubpub-zz
textproc/py-pdf: import py-pdf-3.9.0 pypdf is a free and open-source pure-python PDF library capable of splitting, merging, cropping, and transforming the pages of PDF files. It can also add custom data, viewing options, and passwords to PDF files. pypdf can retrieve text and metadata from PDFs as well.