#9

chore(deps): update rust crate lopdf to 0.47

Openrenovate[bot]wants to merge intofrom

This PR contains the following updates:

PackageTypeUpdateChange
lopdfdev-dependenciesminor0.31 → 0.47

Release Notes

J-F-Liu/lopdf (lopdf)

v0.47.0

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/J-F-Liu/lopdf/compare/v0.46.0...v0.47.0

v0.46.0

Compare Source

What's Changed

New Contributors

Full Changelog: https://github.com/J-F-Liu/lopdf/compare/v0.45.0...v0.46.0

v0.45.0

Compare Source

  • 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

Compare Source

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_content return Vec<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

Compare Source

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_locate dependency to fix a performance regression introduced in v0.35.0.

v0.40.0

Compare Source

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 getrandom to 0.4 and rand to 0.10.
Upgrade
  • Upgrade wasm-bindgen-test while we're at it.

v0.39.0

Compare Source

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

Compare Source

Apply

  • apply fix the warnings
Inline
  • Inline ImageMasks don't need to have a ColorSpace so don't require one.

v0.37.0

Compare Source

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
  • 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

Compare Source

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

Compare Source

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
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
  • Remove superfluous ref keyword (#​361)
  • Remove pom parser (#​355)
  • Remove /Prev from trailer (#​333)
Replace
  • Replace debug assert with Result (#​349)
  • Replace unwrap with error handling (#​351)
Rework
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

Compare Source

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
Refactor
  • Refactor get_or_create_resources() (#​291)
Release
  • Release 0.34
Replace
  • Replace unwrap with returning error (#​310)
  • Replace LinkedHashMap with IndexMap (#​293)
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
AsyncReader
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

v0.32.0

Add

  • Add debug format for hexadecimal (#​240)
Added
  • Added big generation value parsing (#​257)
Added
  • added object parse to get_page_fonts (#​249)
  • added meta info decryption (#​237)
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
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.


This change is 


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.

Written for commit 074647510c92605f9063b8aa749a24a7da8d751e. Summary will update on new commits.

Activity

4
greptile-apps[bot]3d ago

PR author is in the excluded authors list.

coderabbitai[bot]3d ago

IMPORTANT

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 0605f65e-66ae-43d5-9938-2a21aaac43e0

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share