Closed BioBox closed 2 years ago
Sorry for missing this issue. I have added instructions for the new font system: https://github.com/pdf-rs/pdf_render#fonts
Yeah I already did that; my issue was submitted a day after the pdf_fonts
repo was posted.
Without settnig the standard fonts it can't even load the first page. When doing STANDARD_FONTS=../pdf_fonts
I can load the first three pages before the main thread panicks.
Oh wait, there's some additional information I forgot to include:
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Try { file: "render/src/renderstate.rs", line: 227, column: 29, context: Context([]), source: Other { msg: "expected 3 color arguments, got [Number(0.061)]" } }', /home/daniel/proj/rs-pdf/pdf_render/view/src/lib.rs:47:76
You can set allow_error_in_option
to true in ParseOptions
to ignore this.
Okay I set ParseOptions from strict
to tolerant
and set the cargo file to use a patched version of the library and it works fine now. Thank you!
If you want to debug the cause further and think the value is correct, feel free to reopen. I briefly looked at the code and it looks like a bug in the file.
I tried to test this out on a book (first pdf file I tried). The first three pages where fine, but on the fourth page I got this:
Here's a full backtrace:
I get the message "missing fonts:", so it looks like the font instructions don't provide all of the fonts necessary to view my desired content. This should be easy to fix with some extra fonts right? I noticed that there's a
download_fonts.sh
file but it doesn't generate thefonts.json
file needed by pathfinder or whatever it's called so I'm not sure what that's for.Please let me know of a solution because I need to make a pdf viewer and if this doesn't work then I'll have to do it in C++.