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

OCG enablement with string parameter is not well defined

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.14
    • 2.0.15, 3.0.0 PDFBox
    • PDModel

    Description

      The class

       org.apache.pdfbox.pdmodel.graphics.optionalcontent.PDOptionalContentProperties
      

      contains two methods

       setGroupEnabled(String, boolean)

      and

       isGroupEnabled(String)


      accessing the OCG's state using a name as parameter.
      As there can exist various OCG with the same name this access is not well defined.
      The current implementation accesses the first group with this name it can find.

      To make the setter work a solution would be a loop over all groups with the given name and add them to ON or OFF. Consider to rename it to

      setGroupsEnabledByName

      The getter should return some error state if the groups diverge in state - or better drop it ...

      Attachments

        1. original.pdf
          178 kB
          Stefan Ziel
        2. PDFBOX-4496.patch
          2 kB
          Stefan Ziel

        Activity

          People

            tilman Tilman Hausherr
            jjcool Stefan Ziel
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: