pdf-rs / pdf_render

MIT License
104 stars 21 forks source link

Some PDF render blank #1

Closed piegamesde closed 3 years ago

piegamesde commented 3 years ago

This happens with multiple files. I'm testing with PDF files that contain embedded raster images. Some of them seem to work fine though.

piegamesde commented 3 years ago

Wait, what does this crate actually do? Should I move this bug to pathfinder instead?

s3bk commented 3 years ago

If a PDF does not render, here is the correct place to report it. Currently the code for drawing is here: https://github.com/pdf-rs/pdf_render/blob/master/render/src/renderstate.rs#L660

Can you share the problem files?

piegamesde commented 3 years ago

https://ks.imslp.net/files/imglnks/usimg/1/19/IMSLP51726-PMLP01458-Beethoven_Werke_Breitkopf_Serie_16_No_137_Op_27_No_2.pdf

s3bk commented 3 years ago

That file uses the CCITTFaxDecode filter which is not implemented yet. Lets see how difficult it is...

s3bk commented 3 years ago

Might work as of https://github.com/pdf-rs/pdf/commit/155ca085ac0ffdb9986095334cff1b560ba73b3f

piegamesde commented 3 years ago

At least it fails now ;)

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Other { msg: "Unimplemented @ pdf-3ef1c528a9b91eec/37e9966/pdf/src/enc.rs:336" }', pdf_render/view/src/lib.rs:47:92
s3bk commented 3 years ago

Please run cargo update and try again.

s3bk commented 3 years ago

The file above works here, and I don't think I forgot to push anything to github… If your pdf_render repo is up to date and the pdf dependency is updated, it should work.

piegamesde commented 3 years ago

Please run cargo update and try again.

It works now. Maybe consider removing Cargo.lock from the gitignore?

I get a panic on the third page now though: EOF', pdf_render/view/src/lib.rs:47:92

s3bk commented 3 years ago

I can reproduce that error. Needs digging.

s3bk commented 3 years ago

git pull && cargo update -p fax

There appears to be some bug (related to pathfinder?) that causes it to hang sometimes.

s3bk commented 3 years ago

The fix is included in pdf 0.7.2. Closing now. Feel free to reopen if you run into other cases.