jrmuizel / pdf-extract

A rust library for extracting content from pdfs
364 stars 73 forks source link

panic: index out of bounds: the len is 1 but the index is 1 #89

Open Sinderella opened 2 months ago

Sinderella commented 2 months ago

I am unable to provide the PDF file as it contains a lot of PII. Please let me know if it's really required, I can try to redact as much as I can. Cheers!

thread 'main' panicked at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.6/src/lib.rs:1710:51:
index out of bounds: the len is 1 but the index is 1
stack backtrace:
   0: rust_begin_unwind
             at /rustc/7f2fc33da6633f5a764ddc263c769b6b2873d167/library/std/src/panicking.rs:652:5
   1: core::panicking::panic_fmt
             at /rustc/7f2fc33da6633f5a764ddc263c769b6b2873d167/library/core/src/panicking.rs:72:14
   2: core::panicking::panic_bounds_check
             at /rustc/7f2fc33da6633f5a764ddc263c769b6b2873d167/library/core/src/panicking.rs:268:5
   3: <usize as core::slice::index::SliceIndex<[T]>>::index
             at /rustc/7f2fc33da6633f5a764ddc263c769b6b2873d167/library/core/src/slice/index.rs:249:10
   4: core::slice::index::<impl core::ops::index::Index<I> for [T]>::index
             at /rustc/7f2fc33da6633f5a764ddc263c769b6b2873d167/library/core/src/slice/index.rs:18:9
   5: <alloc::vec::Vec<T,A> as core::ops::index::Index<I>>::index
             at /rustc/7f2fc33da6633f5a764ddc263c769b6b2873d167/library/alloc/src/vec/mod.rs:2907:9
   6: pdf_extract::Processor::process_stream
             at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.6/src/lib.rs:1710:51
   7: pdf_extract::output_doc
             at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.6/src/lib.rs:2234:9
   8: pdf_extract::extract_text_from_mem
             at /$HOME/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pdf-extract-0.7.6/src/lib.rs:2169:9
...
jrmuizel commented 2 months ago

Do you know what tool was used to make the PDF?

Sinderella commented 2 months ago

I don't know which exact tool was it, but exiftool gives me the following:

Creator                         : Vault Rendering Engine
Producer                      : Rendering Engine 7.4.1.9