Skip to content

MichaPau/xpdf_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

XpfTools

Wrapper for Xpdf command line tools as a Rust library

Static Badge Static Badge

GPLv3

About

Wrapper for Xpdf's Reader Command line tools

Tools included in this version:

pdfinfo pdftotext

Usage

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())])

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages