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

Can't open PDF with PDFBox: java.awt.color.CMMException: LCMS error 13: Couldn't link the profiles

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.24, 2.0.27, 3.0.0 PDFBox
    • 2.0.28, 3.0.0 PDFBox
    • Rendering
    • None
    • Java: Amazon corretto windows x64 jdk
      OS: Windows 10

    Description

      If I try to open the attached PDF document face the following error message and the document will not be displayed:

       

      java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.awt.color.CMMException: LCMS error 13: Couldn't link the profiles
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:481)
          java.desktop/sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
          java.base/java.security.AccessController.doPrivileged(Native Method)
          java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
      Caused by: java.util.concurrent.ExecutionException: java.awt.color.CMMException: LCMS error 13: Couldn't link the profiles
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.done(PagePane.java:461)
          java.desktop/sun.swing.AccumulativeRunnable.run(AccumulativeRunnable.java:112)
          java.base/java.security.AccessController.doPrivileged(Native Method)
          java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
      Caused by: java.awt.color.CMMException: LCMS error 13: Couldn't link the profiles
          java.desktop/sun.java2d.cmm.lcms.LCMS.createNativeTransform(Native Method)
          java.desktop/sun.java2d.cmm.lcms.LCMS.createTransform(LCMS.java:156)
          java.desktop/sun.java2d.cmm.lcms.LCMSTransform.doTransform(LCMSTransform.java:150)
          java.desktop/sun.java2d.cmm.lcms.LCMSTransform.colorConvert(LCMSTransform.java:624)
          org.apache.pdfbox.pdmodel.graphics.color.PDICCBased.toRGB(PDICCBased.java:351)
          org.apache.pdfbox.rendering.PageDrawer.getPaint(PageDrawer.java:350)
          org.apache.pdfbox.rendering.PageDrawer.getNonStrokingPaint(PageDrawer.java:746)
          org.apache.pdfbox.rendering.PageDrawer.fillPath(PageDrawer.java:878)
          org.apache.pdfbox.contentstream.operator.graphics.FillNonZeroRule.process(FillNonZeroRule.java:37)
          org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:933)
          org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:514)
          org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:492)
          org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:155)
          org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:277)
          org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:347)
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:449)
          org.apache.pdfbox.debugger.pagepane.PagePane$RenderWorker.doInBackground(PagePane.java:1)
          java.base/java.lang.Thread.run(Thread.java:829)
      

      The same document can be successfully opened with Adobe's Acrobat Reader.

      If I add a try catch statement in the affected toRGB function of org.apache.pdfbox.pdmodel.graphics.color.PDICCBased and return the value from the input I'm able to display display the document but the upper and lower bar is yellow instead blue (like in Acrobat Reader).

      @Override
          public float[] toRGB(float[] value) throws IOException
          {
              if (isRGB)
              {
                  return value;
              }
              if (awtColorSpace != null)
              {
                  // PDFBOX-2142: clamp bad values
                  // WARNING: toRGB is very slow when used with LUT-based ICC profiles
                  try {
                      return awtColorSpace.toRGB(clampColors(awtColorSpace, value));
                  } catch (Exception ex) {
                      return value;
                  }
              }
              else
              {
                  return alternateColorSpace.toRGB(value);
              }
          } 

      Unfortunately I'm not familiar with color profiles and color spaces.

      Any suggest how to overcome this problem?

      Thanks in advance.

      Attachments

        1. problem-1.pdf
          7 kB
          Viktor Merkel
        2. PDFBOX-5563.icc
          4 kB
          Tilman Hausherr

        Activity

          People

            tilman Tilman Hausherr
            vmerkel Viktor Merkel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: