aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs37
1 files changed, 2 insertions, 35 deletions
diff --git a/src/main.rs b/src/main.rs
index 4b2d541..3964551 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,38 +1,5 @@
-extern crate lopdf;
-
-use lopdf::{Document, Object};
+use pdf_urls::get_urls_from_pdf;
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());
-
- ()
- },
- _ => (),
- }
- }
- }
- }
- }
-
- ()
- },
- _ => (),
- }
- }
+ get_urls_from_pdf();
}