Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-5791

PDFBox CLI unable to read JPEG Image

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Problem
    • 2.0.27
    • None
    • Utilities
    • None

    Description

      Hi,

      I am trying to use pdfbox-app jar to execute PDFBox commands through CLI. I am using the CLI to convert PDF to Images. While doing so, for some documents PDFBox app jar is unable to read JPEG2000 Image.

      Commands I executed:

      java -jar pdfbox-app-2.0.27.jar PDFToImage og-color-doc.pdf 

      I realized that PDFBox needs additional jars like jai-imageio-core and jai-imageio-jpeg2000 and I tried including these jars in the class path while executing the pdfbox command but I am still running into the same issue. Is there a specific way to ensure that pdfbox-app jar is able to reference the dependencies it needs when I am executing through the CLI?

      I have all jars present in lib directory and upon executing this command I am getting an error indicating:

      Error: Could not find or load main class org.apache.pdfbox.tools.PDFBox
      Caused by: java.lang.ClassNotFoundException: org.apache.pdfbox.tools.PDFBox

      Command:

      java -cp "pdfbox-app-2.0.27.jar;lib/*" org.apache.pdfbox.tools.PDFBox PDFToImage og-color-doc.pdf 

      Can you please help me understand how to pass the specific jars/libraries that pdfbox-app needs while using the CLI?

      Attachments

        1. original_doc-11.jpg
          1.86 MB
          Tilman Hausherr
        2. screenshot-1.png
          138 kB
          Tilman Hausherr

        Activity

          People

            Unassigned Unassigned
            kabir Kabir Soneja
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: