Open bogct0mculhl opened 1 year ago
Hi @bogct0mculhl! Do you want to use the code as a library or as a CLI executable? If you want to use it as a library, the easiest way to do so is probably this:
let bytes = std::fs::read("path/to/example.pdf").unwrap();
let out = pdf_extract::extract_text_from_mem(&bytes);
assert!(out.contains("Yukon Department of Education"));
That pdf is encrypted which is not currently supported. https://github.com/J-F-Liu/lopdf/issues/168
The extract example will now output a warning about it. https://github.com/jrmuizel/pdf-extract/commit/277fe7c5175eac65fda8dcabb960d1bd6e497505
Hi, I'm trying to understand how to use your library, but I'm not able to run your example code corrrectly:
git clone https://github.com/jrmuizel/pdf-extract.git
cd pdf-extract
wget https://orimi.com/pdf-test.pdf
cargo run --example extract pdf-test.pdf
The output file is empty...
cat pdf-test.txt
Using pdftotext the output file is filled with text:
pdftotext -layout pdf-test.pdf
cat pdf-test.txt
Thanks