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

Image with predictor 15 not rendered correctly

    XMLWordPrintableJSON

Details

    Description

      In this file, /DecodeParms has an array with 1 element. The filter is a name object.

      The PDF specification has this:

      A parameter dictionary or an array of such dictionaries, used by the filters specified by Filter. If there is only one filter and that filter has parameters, DecodeParms shall be set to the filter's parameter dictionary unless all the filter's parameters have their default values, in which case the DecodeParms entry may be omitted. If there are multiple filters and any of the filters has parameters set to nondefault values, DecodeParms shall be an array with one entry for each filter: either the parameter dictionary for that filter, or the null object if that filter has no parameters (or if all of its parameters have their default values). If none of the filters have parameters, or if all their parameters have default values, the DecodeParms entry may be omitted.

      Currently PDFBox takes "whatever is there" from the /DecodeParms array / dictionary.

      So now I tried to implement this literally in PDFBox ("If there is only one filter and that filter has parameters, DecodeParms shall be set to the filter's parameter dictionary") and that failed, there are files that have a filter array with 1 element and have a /DecodeParms array with 1 elemenent and these render properly with Adobe Reader, but no longer in PDFBox. So that "incorrect" /DecodeParms array element must be used or it will look bad.

      Then I tried to implement that a dictionary would be expected when the filter was only a name, and that worked, i.e. no regressions, and the SOLR file renders too.

      Attachments

        1. PDFJS-8895-p1.pdf
          76 kB
          Tilman Hausherr

        Activity

          People

            tilman Tilman Hausherr
            tilman Tilman Hausherr
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: