ICEpdf
  1. ICEpdf
  2. PDF-573

Optionl content group visibility not handled correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.0
    • Fix Version/s: 5.0.1
    • Component/s: Core/Parsing
    • Labels:
      None
    • Environment:
      ICEpdf 5.0.0 open source release

      Description

      OptionalContentState keeps track of the visibility state as the PDF document is traversed. It considers content visible if the top of the element of the OptionalContent stack is visible. I believe this is not the correct way to handle this. Instead isVisible should return the logical 'and' of the visibility state of all elements in the stack.

      The attached patch resolves this issue. Additionally it resolves a thread-safety issue related to OptionalContentState.

        Activity

        Hide
        Patrick Corless added a comment -

        Closing for now. PDF loads correctly now although a bit slow because of the image tiles used for the satellite imagery.

        Show
        Patrick Corless added a comment - Closing for now. PDF loads correctly now although a bit slow because of the image tiles used for the satellite imagery.
        Hide
        Patrick Corless added a comment -

        I've taken a slightly different approach to fixing this issue and handle the visibility logic in the OptionalContent init() method. I couldn't find the info in the spec but as the user has posted, if the root group is marked as invisible in the OptionalContent D dictionary then the value should be applied to the child groups. As a result I've updated the recursive parse of the Order dictionary to carry the parent optionalContent when recursively descending into the child elements and can check visibility

        While working thought the PDF a problem was also detected with how we build the layers tree. I've udpated the tree building logic to take into account how child elements can be represented as lists.

        Show
        Patrick Corless added a comment - I've taken a slightly different approach to fixing this issue and handle the visibility logic in the OptionalContent init() method. I couldn't find the info in the spec but as the user has posted, if the root group is marked as invisible in the OptionalContent D dictionary then the value should be applied to the child groups. As a result I've updated the recursive parse of the Order dictionary to carry the parent optionalContent when recursively descending into the child elements and can check visibility While working thought the PDF a problem was also detected with how we build the layers tree. I've udpated the tree building logic to take into account how child elements can be represented as lists.
        Hide
        Pepijn Van Eeckhoudt added a comment -

        Correct behavior can be verified using the PDF that is referenced in the comments of PDF-571. By default the imagery of that PDF should not be displayed (at least that's what other PDF viewers do). ICEpdf 5.0.0 does consider them as visible and displays them. With this patch ICEpdf shows the expected contents.

        Show
        Pepijn Van Eeckhoudt added a comment - Correct behavior can be verified using the PDF that is referenced in the comments of PDF-571 . By default the imagery of that PDF should not be displayed (at least that's what other PDF viewers do). ICEpdf 5.0.0 does consider them as visible and displays them. With this patch ICEpdf shows the expected contents.

          People

          • Assignee:
            Patrick Corless
            Reporter:
            Pepijn Van Eeckhoudt
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: