pdf icon indicating copy to clipboard operation
pdf copied to clipboard

unable to open png's generated by examples

Open Parth opened this issue 2 years ago • 7 comments

Pictured is the example I ran along with the output and the error message. Chrome is also not able to read the image. I'm actually not able to put any pdf through this example for previewing.

image

Parth avatar Jan 14 '24 19:01 Parth

png might be broken. But you can decode it and re-encode it if you need to get it out. I suspect it needs some headers.

s3bk avatar Jan 14 '24 20:01 s3bk

I have a simliar problem with StreamFilter::CCITTFaxDecode. How would I write that reencoding?

jakob-ledermann avatar Feb 07 '24 15:02 jakob-ledermann

@jakob-ledermann I think you can just wrap it with this: https://github.com/pdf-rs/fax/blob/master/src/tiff.rs#L9

s3bk avatar Feb 07 '24 17:02 s3bk

@s3bk Thanks for that information. Somehow I missed it. Do you want a PR to add exporting StreamFilter::CCITTFaxDecode to the read example?

jakob-ledermann avatar Feb 08 '24 12:02 jakob-ledermann

Yea, that would be an easy fix without modifying the api.

s3bk avatar Feb 08 '24 14:02 s3bk