Parse ToC of ETSI PDFs
The pdf crate seems unable to parse the chapter/section info from the etsi pdfs. The manuals from osmocom work and the example 'names' provided by the pdf crate has the same issue:
./target/debug/names ts_148002v100000p.pdf read: ts_148002v100000p.pdf thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Try { file: "pdf/src/file.rs", line: 94, column: 19, source: FromPrimitive { typ: "Option < PdfString >", field: "dest", source: UnexpectedPrimitive { expected: "String", found: "Array" } } }', examples/names/src/main.rs:93:45 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
./target/debug/names ~/dev/doc/gsm/gsm_spec/GSM/by_chapter/08.16.pdf read: /home/daniel/dev/doc/gsm/gsm_spec/GSM/by_chapter/08.16.pdf thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Try { file: "pdf/src/file.rs", line: 94, column: 19, source: Try { file: "pdf/src/object/types.rs", line: 22, column: 42, source: FromPrimitive { typ: "Option < Content >", field: "contents", source: Try { file: "pdf/src/content.rs", line: 90, column: 24, source: UnexpectedPrimitive { expected: "Stream", found: "Array" } } } } }', examples/names/src/main.rs:72:40 note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[src/misc.rs:155] pdf.get_root() = Catalog { pages: Tree( PageTree { parent: None, kids: [ Ref(106), Ref(107), ], count: 20, resources: None, media_box: None, crop_box: None, }, ), names: None, dests: None, outlines: Some( Outlines { count: 34, first: Some( Ref(138), ), last: Some( Ref(139), ), }, ), metadata: Some( (), ), struct_tree_root: None, } [src/misc.rs:156] &pdf.get_root().outlines = Some( Outlines { count: 34, first: Some( Ref(138), ), last: Some( Ref(139), ), }, )
Trying to resolve the Ref fails