GhostScript on CentOS 5.3 - Unable to process JPXDecode data

拈花ヽ惹草 提交于 2019-12-22 06:49:17

问题


I'm trying to get our server to convert PDFs to image files. It's a CentOS 5.3 system and the latest version of ghostscript that can be (8.70), has been installed.

When I try to convert a PDF I get the following error repeated for each page, and the result is a load of blank images.

**** ERROR: Unable to process JPXDecode data. Page will be missing data.

So, I found an answer on here that seemed to answer that question:

iText PDF; howto convert jpeg2000 to jpg using Java

Following that I downloaded iText 5.3.4 and jai_imageio-1.1.jar and compiled the supplied script on my local machine. When I run the final conversion command on my PDF I get:

java.lang.NullPointerException
at com.itextpdf.text.pdf.parser.PdfImageObject.decodeImageBytes(PdfImageObject.java:296)
at com.itextpdf.text.pdf.parser.PdfImageObject.<init>(PdfImageObject.java:199)
at com.itextpdf.text.pdf.parser.PdfImageObject.<init>(PdfImageObject.java:158)
at PDFConverter.hasJpeg2000(PDFConverter.java:36)
at PDFConverter.main(PDFConverter.java:15)
Doesn't contain any JPEG2000 images: Nothing to be done...

I'm not sure whether that's definitely saying that the PDF doesn't have any JPEG2000 images, or whether I've done something wrong when I compiled the script. Perhaps I've got the wrong version of iText since no links were provided in the answer to that other question.

So now I either need help to convert my PDFs to remove any JPEG2000 images, or I need help to get our server running ghostscript properly.

来源:https://stackoverflow.com/questions/13728500/ghostscript-on-centos-5-3-unable-to-process-jpxdecode-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!