brand new to rust and am trying to read a pdf file with lopdf.
trying out various examples but I am just getting characters. I need all the chars like spaces, tabs, line breaks, etc…for Regex.
Is there a better create or does this example miss something?
Also with this app can i set the (x,y) coordinates? (I am addicated to pdfplumber.)
thank you.
fn main() {
let file = "test2.pdf";
let doc = Document::load(file);
match doc {
Ok(document) => {
let text = document.extract_text(&[1]);
println!("{:?}", text);
}
Err(err) => {
eprintln!("{err}")
}
}
}
the results:
DATEACCOUNTTYPETRANSACTIONQUANTITYDESCRIPTIONPRICEVALUETRANSFERDELAWAREHEALTHCAREFD09/09Cash7,395.8230029.0700214,996.57SHSINSTITUTIONALCLASSFROM:****8740-1JACOBDREWES&TRANSFERFEDERATEDHERMES09/09Cash38,561.179005.6600218,256.27STRATEGICVALUEDIVFUNDCLISFROM:****8740-1JACOBDREWES&TRANSFERFIDELITYADVISORS09/09Cash24,241.2660013.5800329,196.39REALESTATEINCOMECLASSIFROM:****8740-1JACOBDREWES&TRANSFERISHARESUSETFTRETF09/09Cash16,622.0000050.1300833,260.86BLACKROCKSHORTMATURITYBDFROM:****8740-1JACOBDREWES&TRANSFERISHARESNATIONALETF09/09Cash7,125.00000116.9300833,126.25MUNIBONDFROM:****8740-1JACOBDREWES&TRANSFERISHARESSHORTTERMETF09/09Cash7,729.00000107.8000833,186.20NATIONALMUNIBONDFROM:****8740-1JACOBDREWES&TRANSFERCOLUMBIASTRATEGIC09/09Cash