chore(deps): update rust crate lopdf to 0.47
This PR contains the following updates:
| Package | Type | Update | Change |
|---|---|---|---|
| lopdf | dev-dependencies | minor | 0.31 → 0.47 |
Release Notes
J-F-Liu/lopdf (lopdf)
v0.47.0
What's Changed
- Fix Identity defaults for V4 and V5 encryption filters by @yhay81 in #624
- Honor decompression limits in object streams and PNG predictors by @yhay81 in #625
- Preserve page attributes and outlines in merge examples by @yhay81 in #626
- Raise the PDF version when plain saves write an xref stream by @yhay81 in #627
- fix: default BitsPerComponent to 1 for inline image masks by @LuisFigueroaG in #628
- fix: find EI after any white-space character when skipping inline images by @LuisFigueroaG in #629
- perf: traverse and prune in linear time by @yhay81 in #630
- perf: delete the objects of delete_pages and delete_zero_length_streams in one traversal by @yhay81 in #631
- fix: move each bookmark once when renumbering objects by @yhay81 in #632
- feat: rebuild the cross-reference table when the page tree does not load by @yhay81 in #636
- fix: save without changing max_id or the trailer by @yhay81 in #633
- feat: report /Trapped in PdfMetadata by @yhay81 in #634
- fix: decode a stream only if it names at most 16 filters by @yhay81 in #635
- Expose Writer for incremental document assembly by @CoenraadS in #637
- feat: report linearization parameters and revision count by @yhay81 in #638
- feat: save options for ASCII-only output and pretty printing by @yhay81 in #639
- fix: skip named destinations without a usable /D instead of panicking by @LuisFigueroaG in #640
- Expose Writer::need_separator / need_end_separator for incremental writers by @CoenraadS in #641
- fix: skip comments in object streams by @wleeaf in #643
- fix: let free cross-reference entries delete objects of earlier revisions by @wleeaf in #642
- fix: append to a referenced /Contents array in add_page_contents by @LuisFigueroaG in #644
- fix: handle a referenced /Contents array in change_page_content by @LuisFigueroaG in #645
- fix: keep inherited /Resources when adding resources to a page by @LuisFigueroaG in #646
- fix: do not recover an object deleted by a later update from an object stream by @Slurp9187 in #648
- fix: write the key lengths in a V5 encryption dictionary by @Slurp9187 in #647
- fix: write a whole-number real with its point by @Slurp9187 in #649
- fix: follow a referenced /ExtGState in add_graphics_state by @LuisFigueroaG in #650
- fix: copy a referenced /XObject in IncrementalDocument::add_xobject by @LuisFigueroaG in #651
- fix: do not print the file encryption key and passwords in Debug output by @Slurp9187 in #653
- fix: parse dates that leave out the UT offset by @ryanduguid in #652
- fix: return an inherited /Resources dictionary from get_page_resources by @LuisFigueroaG in #654
- fix: follow referenced arrays in the named destinations tree by @LuisFigueroaG in #657
- fix: resolve a referenced /Title on outline items that use /Dest by @LuisFigueroaG in #659
- fix: bound stream decompression by default by @wn-mitch in #656
New Contributors
- @CoenraadS made their first contribution in #637
- @wleeaf made their first contribution in #643
- @Slurp9187 made their first contribution in #648
- @ryanduguid made their first contribution in #652
- @wn-mitch made their first contribution in #656
Full Changelog: https://github.com/J-F-Liu/lopdf/compare/v0.46.0...v0.47.0
v0.46.0
What's Changed
- fix: derive the file encryption key from the recovered user password, not the literal owner password by @chintans in #573
- perf: build the missing-key error of Dictionary::get lazily by @melnik0v in #577
- fix: detect reference cycles through object stream containers by @melnik0v in #576
- feat: add Document::get_page_annotations_mut by @ChrisJr404 in #571
- perf: decode each object stream once per load by @melnik0v in #578
- fix: export DateTime from crate root by @isaim0011 in #579
- fix: preserve text after unmapped tounicode codes by @szdytom in #580
- fix: keep an unloadable page-tree kid as a blank page slot by @abimaelmartell in #583
- fix: read one white-space character after ID in inline images by @ghempton in #582
- fix: derive the file key from the sanitized password on load by @LuisFigueroaG in #586
- fix: tolerate padding after %%EOF when locating startxref by @LuisFigueroaG in #587
- fix: don't panic on huge predictor DecodeParms by @LuisFigueroaG in #589
- fix: handle missing and indirect /Annots in remove_annot by @LuisFigueroaG in #590
- fix: treat /Type and /Differences as optional in encoding dictionaries by @LuisFigueroaG in #591
- fix: parse UTC and shortened dates with the time backend by @LuisFigueroaG in #592
- feat: decode content operations one at a time with Content::decode_iter by @josh-prefix in #588
- fix: don't overflow when incrementing a multi-unit bfrange target by @LuisFigueroaG in #593
- fix: don't overflow computing inline image data length by @LuisFigueroaG in #594
- fix: apply array DecodeParms per filter by @sean0407 in #596
- fix: read /XRefStm in every section of hybrid-reference files by @LuisFigueroaG in #598
- fix: accept the /G abbreviation and Indexed colour spaces in inline images by @LuisFigueroaG in #597
- fix: treat NUL and form feed as white-space in content streams by @jaenam615 in #599
- fix: allow delimiters without white-space in ToUnicode CMaps by @jaenam615 in #600
- fix: parse the Type 3 glyph operators d0 and d1 in content streams by @LuisFigueroaG in #601
- fix: bound cross-reference stream object numbers to u32 by @LuisFigueroaG in #602
- fix: consume the fields of unknown cross-reference stream entry types by @LuisFigueroaG in #604
- fix: read unescaped end-of-line markers in literal strings as a line feed by @LuisFigueroaG in #605
- fix: ignore a minus sign inside the fraction of a real number by @LuisFigueroaG in #606
- fix: write decoded inline images back as BI/ID/EI when encoding content by @LuisFigueroaG in #607
- fix: drop /Prev and /XRefStm from a reconstructed trailer by @yhay81 in #609
- perf: keep the reconstruction scan linear when streams lack endstream by @yhay81 in #610
- fix: correct an xref offset only when the section found locates its objects by @yhay81 in #611
- feat: report cross-reference recovery in Document and PdfMetadata by @yhay81 in #612
- fix: stop new object IDs from wrapping past u32::MAX by @yhay81 in #614
- perf: speed up the object parser by @yhay81 in #616
- fix: keep tabs and line breaks when decoding PDFDocEncoding text strings by @LuisFigueroaG in #617
- feat: reconstruct files that only have cross-reference streams by @yhay81 in #613
- perf: parse small documents on the calling thread instead of rayon's pool by @yhay81 in #618
- fix: strip the UTF-8 byte order mark when decoding text strings by @LuisFigueroaG in #619
- fix: decode outline titles as text strings in get_toc by @LuisFigueroaG in #620
- fix: ignore an odd trailing byte in UTF-16BE text strings by @LuisFigueroaG in #621
- fix: use inherited /Resources in get_page_images by @LuisFigueroaG in #622
New Contributors
- @chintans made their first contribution in #573
- @melnik0v made their first contribution in #577
- @ChrisJr404 made their first contribution in #571
- @isaim0011 made their first contribution in #579
- @szdytom made their first contribution in #580
- @ghempton made their first contribution in #582
- @LuisFigueroaG made their first contribution in #586
- @josh-prefix made their first contribution in #588
- @sean0407 made their first contribution in #596
- @jaenam615 made their first contribution in #599
Full Changelog: https://github.com/J-F-Liu/lopdf/compare/v0.45.0...v0.46.0
v0.45.0
- Accept 19-byte cross-reference entries when parsing leniently (#564)
- Accept an integral real /Length when resolving deferred streams (#560)
- Add option to set FirstChar, LastChar and the Widths array of a custom font (#557)
- Bound cross-reference subsection object numbers to u32
- Bound xref-stream entry count against the decoded stream length
- Bound object-graph recursion depth (fix #530)
- Decode sub-byte-depth PNG and TIFF predictors
- Decode ASCIIHexDecode and RunLengthDecode streams
- Default the file encryption key length from V when Length is absent
- Fix ASCII85 group-value overflow and decode TIFF Predictor 2
- Fix four crash bugs from crafted PDFs (fix #532)
- Recover from slightly miswritten startxref / Prev offsets
- Silence lints introduced by Rust 1.98
- Use skrifa instead of unmaintained ttf-parser
- Write a cross-reference stream when object streams are disabled
v0.44.0
Add
- Add back assets/test.pdf
Feat
- Support incremental save of encrypted documents (#522)
- Bound text extraction against decompression bombs
- Bound load-time decompression via LoadOptions.max_decompressed_size
- Bound stream decompression to guard against bombs
- Make ttf-parser optional behind font_embedding feature
Fix
- Reject incremental save of encrypted documents (#521)
- Fix Document::get_toc() dropping entries when outline titles repeat (#517)
- Add feature flag to font test
- Only use criterion for non-wasm tests/benches
Move
- Move resource files in tests to assets
Refactor
- Make
Document::get_page_contentreturnVec<u8>since it cannot fail
Test
- Add tests demonstrating unbounded stream decompression
CI
- CI skip performance test
- Actually pass --no-default-features in the no-default-features matrix cell (#510)
v0.43.0
Feat
- Report encryption status in PdfMetadata
v0.42.0
Feat
- Add Content::decode_strict method for strict parsing
Fix
- Limit array and dictionary nesting depth
- Include subsequent ObjStm objects in xref stream range
- Insert newline between concatenated content streams
- Consume trailing comments in content streams
Test
- Escape trailing whitespace in parser tests
v0.41.0
Add
- Add test to reproduce bug with replacing text in non-single character TJ Arrays
- Add regression test PDF file
- Add performance tests for document loading and page counting
Fix
- Fix bug replacing text in non-single character TJ Arrays
- fix clippy errors
Implement
- Implement differences mapping
Release
- Release 0.41
Removes
- Removes
nom_locatedependency to fix a performance regression introduced in v0.35.0.
v0.40.0
Fix
- Fix a few warnings.
- Fix WinAnsiEncoding handling in SimpleEncoding string conversion
Release
- Release 0.40
Remove
- Remove an unused dependency.
Return
- return Option via ok() instead of unwrap() for decode_text_string
Update
- update src/reader to make clippy happy
Update
- Update
getrandomto 0.4 andrandto 0.10.
Upgrade
- Upgrade
wasm-bindgen-testwhile we're at it.
v0.39.0
Add
- add tests
Fix
- fix conditionally compile encrypted metadata tests
- fix test_metadata and clippy warnings
- fix readme example ci issue
- fix clippy ci failed
Release
- Release 0.39
Breaking change
is_encrypted() now returns false after successful
decryption. Use was_encrypted() to check original encryption state.
v0.38.0
Apply
- apply fix the warnings
Inline
- Inline ImageMasks don't need to have a ColorSpace so don't require one.
v0.37.0
Add
- add unicode replace support (#421)
Avoid
- Avoid unwrapping object streams when decrypting documents
Change
- Change remove_object() to only remove the object (#423)
Ensure
- Ensure we only encrypt with compliant P-values
Fix
- fix bug (#422)
Fix
- Fix clippy
- Fix bug by encoding OE, UE and Perms for revision 5
Implement
- Implement tests to encrypt and decrypt documents
- Implement tests for the password algorithms
Improve
- Improve readability by consistently iterating over blocks
- Improve Length field checks
Retain
- Retain permission bits
Set
- Set up WASI CI
- Set up WASM CI workflow
Update
- Update changelog
v0.36.0
Add
- Add support for Revision 5 (#401)
- Add more checks to the encryption/decryption logic (#399)
- Add sanity checks for PDF encryption, add examples for decrypting/encrypting PDF files and various bug fixes (#397)
- Add encrypt function to crypt filters
- Add support for jiff and make both chrono and time optional features
Avoid
- Avoid parsing encrypted object streams early and correctly parse object streams upon decryption (#385)
- Avoid decrypting cross-reference streams (#381)
Check
- Check if the security handler is the standard one
Clarify
- Clarify datetime parsing logic using the PDF specification
Compute
- Compute the file encryption key (revision 6)
Declare
- Declare and implement crypt filters
Ensure
- Ensure the document is actually encrypted
Fix
- Fix unused imports
- Fix warning for rotate example
- Fix warnings about nom_parser
- Fix clippy warning about operator precedence
- Fix typo in comment
Gracefully
- Gracefully handle the is_aes check without throwing errors (#376)
Handle
- Handle cases where the stream objects override the crypt filter
Implement
- Implement Document::encrypt() (#396)
- Implement password authentication (revision 6)
- Implement decrypt with and without password sanitization
- Implement authentication functions
- Implement password sanitization from string
- Implement password algorithms 2-7
- Implement encrypt_object function
- Implement and use PKCS#5 padding instead
- Implement function to parse the available crypt filters
- Implement 256-bit AES-CBC crypt filter
- Implement TryFrom rather than TryInto
Improve
- Improve the AES decryption with some sanity checks (#383)
Merge
- Merge remaining algorithms functions into PasswordAlgorithm implementation
Missing
- Missing import to test
Only
- Only encode EncryptMetadata when V >= 4 (#400)
Provide
- Provide revision-agnostic functions for the password algorithms
Randomly
- Randomly generate file encryption key for V5 in encrypt example (#403)
Recurse
- Recurse into arrays and dictionaries to fully decrypt all strings/streams (#378)
Release
- Release 0.36
Remove
- Remove the old implementation
- Remove workflow that used to enable the nom_parser feature
- Remove nom_parser feature
Reorganize
- Reorganize encryption code
Sanitize
- Sanitize passwords (revision 6)
Try
- Try decrypting with an empty password
Unpack
- Unpack objects after decrypting object streams (#382)
Update
- Update to nom 8.0 and nom_locate 5.0 (#402)
Update
- update changelog
Use
- Use a hasher instead of allocating a Vec
- Use the new implementation to compute the file encryption key
- Use the default stream and string crypt filter if present
- Use Unix epoch if time feature is not enabled
- Use get_deref for the Kids array to handle indirect references (#379)
Validate
- Validate encryption dictionary for revision 5 (#405)
Validate
- validate binary comment during parsing (#392)
v0.35.0
Add
- Add test for supported color types in PDF image embedding
- Add function for text chunks extraction. (#342)
Added
- added binary comment as attribute and for load and write. Binary Comment is gonna be important for pdf in A/2, A/3 format. (#370)
Allow
- Allow parsing off-spec PDF files with prefixes before the header (#362)
Also
- Also accept ASCII85 streams without EOD marker (#354)
Fix
- Fix clippy warning
- Fix incorrect image data handling in PDF content stream
- Fix BitsPerComponent calculation and improper ColorSpace mapping
- Fix incorrect color type detection for JPEG images
- Fix mulitplication overflow in ascii85 decode (#348)
- Fix out of memory bug (#347)
- Fix addition overflow (#346)
- Fix lowercase s of Procset and no space target string(J-F-Liu#323) (#324)
Ignore
- Ignore space after byte index of startxref (#371)
Implement
- Implement ToUnicode for variadic len encodings (#328)
Improve
- Improve JPEG processing efficiency by avoiding unnecessary decode (#345)
- Improve cmap parsing and internal error handling (#335)
Inline
- Inline images (#356)
Keep
- keep existing values when extending dictionary (#322)
Properly
- Properly support document prefixes (#365)
Refactor
- Refactor and optimize image processing logic in xobject.rs
Release
- Release 0.35
Remove
- remove misleading Object::as_string (#350)
Remove
Replace
Rework
- Rework errors (#358)
Specify
- Specify minimum Rust version in Cargo.toml (#320)
Support
- Support UTF-16 encoding for bookmark titles with non-ASCII characters (#364)
- Support AES encryption and revision 4 (#343)
Throw
- Throw error if xref stream cannot be uncompressed (#339)
Update
- update changelog
v0.34.0
Add
- Add ASCII85 decoding (#317)
- Add text extraction based on ToUnicode cmap (#314)
- Add error handling to object stream (#299)
- Add PDFDocEncoding (#296)
Cleanup
- Cleanup comments and cargo fmt (#290)
Detect
- Detect reference cycles when going through trailers (#308)
- Detect reference cycles when parsing streams (with nom_parser) (#300)
- Detect reference cycles when collecting page resources (#298)
Fix
- Fix unicode fonts extraction in extract text example. (#315)
- Fix clippy warings
Implement
- Implement encoding and decoding of text strings (PDF1.7 section 7.9.2.2) (#297)
Improve
- Improve error handling (#307)
Refactor
- Refactor get_or_create_resources() (#291)
Release
- Release 0.34
Replace
Update
v0.33.0
Accept
- Accept comments in content parsing (#261)
Added
- Added a new feature to get images info from the pdf page. (#275)
Async
- Async Examples (#266)
AsyncReader
- AsyncReader (#265)
Fix
- Fix parse outline failed, the key ’D‘ might be an object id (#274)
- Fix parse outline failed(#270) (#271)
Indexmap
- indexmap use in TOC for sorted TOC (#267)
Release
- Release 0.33
Replace
- Replace md5 with md-5 (#272)
v0.32.0
Add
- Add debug format for hexadecimal (#240)
Added
- Added big generation value parsing (#257)
Added
Fix
- Fix clippy warning and format code
- Fix clippy warnings
- Fix typo in README.md (#251)
Fixed
- Fixed parsing of the PDFs with incorrect xrefs to indirect objects (#254)
Fixed
- fixed clippy issues (#238)
Handle
- Handle references to arrays in get_page_contents() (#245)
Object
- Object and related types implement PartialEq (#236)
Release
- Release 0.32
Configuration
📅 Schedule: (UTC)
- Branch creation
- At any time (no schedule defined)
- Automerge
- At any time (no schedule defined)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
- If you want to rebase/retry this PR, check this box
This PR was generated by Mend Renovate. View the repository job log.
Summary by cubic
Updates the lopdf dev-dependency from 0.31 to 0.47. This major jump adds encryption support, bounds stream decompression to guard against bombs, improves PDF parsing robustness, and brings performance improvements. The update pulls in nom 8.0 and new crypto and compression dependencies.