Skip to content

Commit

Permalink
Merge pull request #56 from efx/address-55-part-1
Browse files Browse the repository at this point in the history
print document metadata values using as_str
  • Loading branch information
s3bk authored Aug 25, 2020
2 parents cdfaab0 + 4fc7fb1 commit 281e530
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/metadata/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ fn main() -> Result<(), PdfError> {

let file = File::<Vec<u8>>::open(&path).unwrap();
if let Some(ref info) = file.trailer.info_dict {
eprintln!("{:?}", info);
info.iter()
.filter(|(_, primitive)| primitive.as_str().is_some())
.for_each(|(key, value)| {
eprintln!("{:>15}: {}", key, value.as_str().unwrap());
});
}

Ok(())
Expand Down

0 comments on commit 281e530

Please sign in to comment.