extern crate lopdf; use lopdf::{Document, Object}; fn main() { let doc = Document::load("example.pdf").unwrap(); for (_, obj) in doc.objects { match obj { Object::Dictionary(d) => { for (k, v) in d.iter() { let key = ::std::str::from_utf8(&k).unwrap(); if key == "A" { for (k, v) in v.as_dict().unwrap() { let key = ::std::str::from_utf8(&k).unwrap(); if key == "URI" { match v { Object::String(s, _) => { println!("{}", ::std::str::from_utf8(s).unwrap()); () }, _ => (), } } } } } () }, _ => (), } } }