Wrapper for Xpdf command line tools as a Rust library
GPLv3
Wrapper for Xpdf's Reader Command line tools
Tools included in this version:
pdfinfo pdftotext
You need the Xpdf Command Line Tools to use this wrapper library.
use xpdf_tools::types::XpdfArgs;
use xpdf_tools::XpdfTools;
...
let tools = XpdfTools::builder(PathBuf::from("path/to/the/tools/folder")).unwrap()
.extra_args(vec![XpdfArgs::RawDates, XpdfArgs::Metadata])
.build();
match tools.pdf_info("path/to/the/pdf/file") {
Ok(pdf_info) => {
println!("{:#?}", pdf_info.info_map);
},
Err(e) => println!("{:?}", e),
}
Non english languages may need
.extra_args(vec![XpdfArgs::Encoding("UTF-8".into())])