jrmuizel / pdf-extract

A rust library for extracting content from pdfs
396 stars 78 forks source link

Upgrade lopdf to version 0.26 to resolve panic #28

Open rondonjon opened 2 years ago

rondonjon commented 2 years ago

Installed pdf-extract = "^0.6" and got the following error when trying to parse a PDF:

thread 'main' panicked at 'attempted to leave type `linked_hash_map::Node<std::vec::Vec<u8>, object::Object>` uninitialized, which is invalid', /rustc/c8dfcfe046a7680554bf4eb612bad840e7631c4b/library/core/src/mem/mod.rs:663:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Searched and found a similar bug here that was solved by upgrading lodpf to 0.26.

Installing the latest version leads to new errors in pdf-extract because the Document was moved since lopdf 0.24:

output_doc(&doc, output.as_mut());
   |                ^^^^ expected struct `lopdf::document::Document`, found struct `lopdf::Document`

Sorry, total Rust noob here

jrmuizel commented 2 years ago

I published a new version. Hopefully that helps.

ngirard commented 2 years ago

@rondonjon, can we consider this issue as solved ?