ICEpdf
  1. ICEpdf
  2. PDF-291

Error getting ICCBased colour

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.2
    • Fix Version/s: 4.2.2
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      -

      Description

      The attached test file´s embedded fonts do not render. The PDF file was created with GS 9 (PdfCreator 1.2.0). Here is the exception:

      FINE: Error getting ICCBased colour
      java.awt.color.ProfileDataException: Invalid profile sequence
      at sun.awt.color.ICC_Transform.<init>(ICC_Transform.java:103)
      at java.awt.color.ICC_ColorSpace.toRGB(ICC_ColorSpace.java:148)
      at org.icepdf.core.pobjects.graphics.ICCBased.getColor(ICCBased.java:178)
      at org.icepdf.core.util.ContentParser.consume_SC(ContentParser.java:1797)
      at org.icepdf.core.util.ContentParser.parse(ContentParser.java:661)
      at org.icepdf.core.pobjects.Page.init(Page.java:390)
      at org.icepdf.core.views.swing.PageViewComponentImpl$PageInitilizer.run(PageViewComponentImpl.java:1077)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)
      Apr 11, 2011 4:40:34 PM org.icepdf.core.pobjects.graphics.ICCBased getColor
      1. 10029.pdf
        55 kB
        Tyler Johnson

        Activity

        Hide
        Patrick Corless added a comment -

        I've taken a pretty close look at this issue and it comes down to a major parsing issue with our ListeralString and HextString objects. In the case of the is PDF we convert convert "\u001A\u0011" to 6673 instead of \u001A and \u0011.

        This issue has been present for quite some time but generally only shows up in with Asian content which makes it harder to to recognize. Need some more time to review the spec as to the proper way of parsing these types of strings.

        Show
        Patrick Corless added a comment - I've taken a pretty close look at this issue and it comes down to a major parsing issue with our ListeralString and HextString objects. In the case of the is PDF we convert convert "\u001A\u0011" to 6673 instead of \u001A and \u0011. This issue has been present for quite some time but generally only shows up in with Asian content which makes it harder to to recognize. Need some more time to review the spec as to the proper way of parsing these types of strings.
        Hide
        Patrick Corless added a comment -

        I have a fix for this issue for the PRO version of ICEpdf. In general CID fonts should define character codes with 2 byte or 4 bytes. However there is handful of documents out there that us CID fonts but specify one byte encoding in the font base name or have an encoding that only specifies a cid in the range of 00 to FF.

        I can't find any info on this in the spec but that isn't uncommon for such a corner case. The PRO font engine CMap class can detect one byte mapping but the OS cmap class does not have this feature at this time.

        The checked in fixes address the missing glyphs and a run though QA doesn't show any regressions.

        Show
        Patrick Corless added a comment - I have a fix for this issue for the PRO version of ICEpdf. In general CID fonts should define character codes with 2 byte or 4 bytes. However there is handful of documents out there that us CID fonts but specify one byte encoding in the font base name or have an encoding that only specifies a cid in the range of 00 to FF. I can't find any info on this in the spec but that isn't uncommon for such a corner case. The PRO font engine CMap class can detect one byte mapping but the OS cmap class does not have this feature at this time. The checked in fixes address the missing glyphs and a run though QA doesn't show any regressions.
        Hide
        Patrick Corless added a comment -

        Closing, hoping for feedback from client.

        Show
        Patrick Corless added a comment - Closing, hoping for feedback from client.
        Hide
        Bug Menot added a comment -

        Hi,
        how can I resolve this problem in open source version of icepdf?

        thanks.

        Show
        Bug Menot added a comment - Hi, how can I resolve this problem in open source version of icepdf? thanks.
        Hide
        Patrick Corless added a comment -

        Could you post a sample file of the problem you are seeing, so we can confirm its the same issue?

        Show
        Patrick Corless added a comment - Could you post a sample file of the problem you are seeing, so we can confirm its the same issue?
        Hide
        Bug Menot added a comment -

        Hi Patrick,
        thanks for your help. When open the attached file in the open source version of icepdf I obtain a blank page. The problem is that the convertToString method of CMap.java class receives a CharSequence s of length 1. Incidentally I noted that the same method contains a bug: if (s == null && s.length() % 2 != 0) I think should instead be if (s == null || s.length() % 2 != 0). But I don't think that is the problem.

        P.S. Sorry but I'm not able to attach the file so I sent you the link where you can download it: https://www.dropbox.com/s/yr7slv1tgxnc87t/Atto2.pdf?dl=0

        Thanks for you time,
        Giorgio

        Show
        Bug Menot added a comment - Hi Patrick, thanks for your help. When open the attached file in the open source version of icepdf I obtain a blank page. The problem is that the convertToString method of CMap.java class receives a CharSequence s of length 1. Incidentally I noted that the same method contains a bug: if (s == null && s.length() % 2 != 0) I think should instead be if (s == null || s.length() % 2 != 0). But I don't think that is the problem. P.S. Sorry but I'm not able to attach the file so I sent you the link where you can download it: https://www.dropbox.com/s/yr7slv1tgxnc87t/Atto2.pdf?dl=0 Thanks for you time, Giorgio

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Tyler Johnson
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: