gen2brain / go-fitz

Golang wrapper for the MuPDF Fitz library
GNU Affero General Public License v3.0
369 stars 87 forks source link

Error when convert PDF to Image #107

Open guoquanle opened 1 month ago

guoquanle commented 1 month ago

cleancode.pdf when using doc.Image(pageNumber),this PDF will error, error page is 211.

error info: warning: jbig2dec error: DW value (-75) would make SYMWIDTH (0) negative at symbol 655 (segment 0) warning: jbig2dec warning: failed to decode; treating as end of file (segment 0) error: aborting process from uncaught error!

gen2brain commented 1 month ago

Try with an external library, the bundled library is compiled without CJK.

guoquanle commented 1 month ago

Any external library can be recommend? And I encountered a situation where there was no CJK before, and it gave such an error instead of a direct crash. error: cannot find builtin CJK font

gen2brain commented 1 month ago

You need MuPDF library installed, then use extlib tag, and if needed add static or pkgconfig tags.