ICEpdf
  1. ICEpdf
  2. PDF-1012

Improve Widget content stream parsing (form edits).

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.2
    • Fix Version/s: 6.1.3
    • Component/s: Forms
    • Labels:
      None
    • Environment:
      PRO, editable forms

      Description

      A client has submitted a set documents that were generated with open office and contain form widgets. The files have quite a different dialect then other form/widget examples we have.

      There appears to be main problems with how we hare dealing with these documents:
      1.) font resources aren't correctly assigned and new content streams can not be rendered because the font can't be found
      2.) Not correctly parsing a hex stream with a 4 byte marker.
      3.) Content streams for some widgets are incomplete, widget has a value but only has a partial content stream.

        Activity

        Hide
        Patrick Corless added a comment -

        1) Once the font resource problem was identified it became clear the EL based search wasn't robust enough. A move to using our content parser to parse the content stream was uses and then would could look at the graphicsState object to derive font name, font, size and colour. This appears to be work well across our test set.

        2) when moving into a field for edit, and then a loss of focus causes the content stream to be regenerated. In the sample we are working with hex strings and in particular 4-byte character codes. The marker is FFEF but when we convert the hex value to regular string there was a bug where the marker was also being copied.

        3) Generally speaking a widget will have a content stream as well as field dictionary value. The content of the content stream represents the content value. The are cases where there is field dictionary value and a null content stream and the viewer must generate a content stream. In this particular there is a field dictionary value and a partial content stream that does not represent the value. This is a bit of a issue we generally only regenerate a content stream on a change event not on initialization. Detecting this difference is also tricky.

        Show
        Patrick Corless added a comment - 1) Once the font resource problem was identified it became clear the EL based search wasn't robust enough. A move to using our content parser to parse the content stream was uses and then would could look at the graphicsState object to derive font name, font, size and colour. This appears to be work well across our test set. 2) when moving into a field for edit, and then a loss of focus causes the content stream to be regenerated. In the sample we are working with hex strings and in particular 4-byte character codes. The marker is FFEF but when we convert the hex value to regular string there was a bug where the marker was also being copied. 3) Generally speaking a widget will have a content stream as well as field dictionary value. The content of the content stream represents the content value. The are cases where there is field dictionary value and a null content stream and the viewer must generate a content stream. In this particular there is a field dictionary value and a partial content stream that does not represent the value. This is a bit of a issue we generally only regenerate a content stream on a change event not on initialization. Detecting this difference is also tricky.
        Hide
        Patrick Corless added a comment -

        Fairly large commit to address the various issues listed above. When widgets are rendered the first time we rebuild the content stream to make sure it matches the values stored in the value store in the annotation.

        Show
        Patrick Corless added a comment - Fairly large commit to address the various issues listed above. When widgets are rendered the first time we rebuild the content stream to make sure it matches the values stored in the value store in the annotation.
        Hide
        Patrick Corless added a comment -

        Marking as closed for for now.

        Show
        Patrick Corless added a comment - Marking as closed for for now.
        Hide
        Patrick Corless added a comment -

        The client sent one more example that has several text fields that don't appear to be editable. After a little debugging the fields have now content stream and the default appearance is set with a font size of zero. So the text is editable but one can't see it.

        I've update the parser take into account that a zero size is possible and correct for it.

        Show
        Patrick Corless added a comment - The client sent one more example that has several text fields that don't appear to be editable. After a little debugging the fields have now content stream and the default appearance is set with a font size of zero. So the text is editable but one can't see it. I've update the parser take into account that a zero size is possible and correct for it.

          People

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

            Dates

            • Created:
              Updated:
              Resolved: