dichovsky / pdf-to-png-converter

Library Convert PDF to PNG
MIT License
110 stars 26 forks source link

Failed to parse this pdf: #41

Closed AChangXD closed 10 months ago

AChangXD commented 10 months ago

sample.pdf

This is a sample pdf that pdf-to-png-converter is failing to parse. It returns blank pngs (all white)

Feeloh commented 10 months ago

I also got this issue, with some pdf(s) it renders a blank canvas.

AChangXD commented 10 months ago

I also got this issue, with some pdf(s) it renders a blank canvas.

If you use text retrieval after getDocument, it does show up

Feeloh commented 10 months ago

I also got this issue, with some pdf(s) it renders a blank canvas.

If you use text retrieval after getDocument, it does show up

Thanks, the issue is I am dynamically attaching the generated images to an excel file. I have resorted to using another package for now.

Thank you very much.

AChangXD commented 10 months ago

package

@Feeloh What package did you end up using? Could you kindly share a link please? :)

AChangXD commented 10 months ago

So seems like PDFjs is parsing things properly? https://jsfiddle.net/AChangXD/buno8j9s/1/. So most likely an issue with canvas

Feeloh commented 10 months ago

@AChangXD I opted for https://www.npmjs.com/package/pdf-to-img so far so good, the failed test pdfs are rendering well.

dichovsky commented 10 months ago

sample.pdf

This is a sample pdf that pdf-to-png-converter is failing to parse. It returns blank pngs (all white)

For this particular file use

        disableFontFace: false
        useSystemFonts: false

File is rendered in my side

AChangXD commented 10 months ago

sample.pdf This is a sample pdf that pdf-to-png-converter is failing to parse. It returns blank pngs (all white)

For this particular file use

        disableFontFace: false
        useSystemFonts: false

File is rendered in my side

Is there a reason why those parameters aren't the default setting?

dichovsky commented 10 months ago

sample.pdf This is a sample pdf that pdf-to-png-converter is failing to parse. It returns blank pngs (all white)

For this particular file use

        disableFontFace: false
        useSystemFonts: false

File is rendered in my side

Is there a reason why those parameters aren't the default setting?

Different documents require different parameters, there is no golden rule. These params are set to values that I use in other libs for testing on macos