pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "jorgeeflorez ." <jorgeeduardoflo...@gmail.com>
Subject (JAI) Image I/O Tools are not installed
Date Tue, 28 Feb 2017 16:19:59 GMT
Hi all,

I am getting some errors with version 2.0.4. In a small maven project I set
up, when I try to render a page from a PDF file, I get this in console:

ERROR [main] (PDFStreamEngine.java:866) - Cannot read JPEG2000 image: Java
Advanced Imaging (JAI) Image I/O Tools are not installed

This is the pom for the project:
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>
    <dependencies>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox</artifactId>
            <version>2.0.4</version>
        </dependency>
        <dependency>
            <groupId>org.apache.pdfbox</groupId>
            <artifactId>pdfbox-tools</artifactId>
            <version>2.0.4</version>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>commons-logging</groupId>
            <artifactId>commons-logging</artifactId>
            <version>1.2</version>
        </dependency>
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.4</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcprov-jdk15on</artifactId>
            <version>1.55</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcmail-jdk15on</artifactId>
            <version>1.55</version>
        </dependency>
        <dependency>
            <groupId>org.bouncycastle</groupId>
            <artifactId>bcpkix-jdk15on</artifactId>
            <version>1.55</version>
        </dependency>
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>

        <dependency>
            <groupId>com.levigo.jbig2</groupId>
            <artifactId>levigo-jbig2-imageio</artifactId>
            <version>1.6.5</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.jai-imageio</groupId>
            <artifactId>jai-imageio-core</artifactId>
            <version>1.3.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>com.github.jai-imageio</groupId>
            <artifactId>jai-imageio-jpeg2000</artifactId>
            <version>1.3.0</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

I added the dependencies you suggest (I think) in
https://pdfbox.apache.org/2.0/dependencies.html.

After some debugging I came up with this stack trace:

org.apache.pdfbox.filter.MissingImageReaderException: Cannot read JPEG2000
image: Java Advanced Imaging (JAI) Image I/O Tools are not installed
    at org.apache.pdfbox.filter.Filter.findImageReader(Filter.java:128)
    at org.apache.pdfbox.filter.JPXFilter.readJPX(JPXFilter.java:87)
    at org.apache.pdfbox.filter.JPXFilter.decode(JPXFilter.java:57)
    at org.apache.pdfbox.cos.COSInputStream.create(COSInputStream.java:69)
    at org.apache.pdfbox.cos.COSStream.createInputStream(COSStream.java:162)
    at
org.apache.pdfbox.pdmodel.common.PDStream.createInputStream(PDStream.java:235)
    at
org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject.<init>(PDImageXObject.java:160)
    at
org.apache.pdfbox.pdmodel.graphics.PDXObject.createXObject(PDXObject.java:70)
    at
org.apache.pdfbox.pdmodel.PDResources.getXObject(PDResources.java:409)
    at
org.apache.pdfbox.contentstream.operator.graphics.DrawObject.process(DrawObject.java:53)
    at
org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:829)
    at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:486)
    at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:460)
    at
org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:150)
    at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:189)
    at
org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:145)
    at
org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:94)

It is trying to get a reader for "JPEG2000" and can't find it. Am I missing
something to make it work? or should I think that the pdf file has some
"unusual" image inside it?

Thanks in advance for your help.

Best Regards.

Jorge Flórez

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message