ICEpdf
  1. ICEpdf
  2. PDF-1071

Enhanced annotation tools that support alpha value.

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.1.3
    • Fix Version/s: 6.2
    • Component/s: API, Viewer RI
    • Labels:
      None
    • Environment:
      Any

      Description

      ICEpdf has had annotation creation tools for quite some time but they were never designed to support the PDF transparency model. This is further complicated by the fact the default java colour picker allows users to select rgba colour values but the PDF specification only allows the setting of rgb values (actually other colour models too but none with alpha).

      Transparency was not possible in early version of the PDF specification and as a result to support legacy viewers the addition of alpha support had to be done in a way not to break backwards compatibility. As a result the extended graphics state was introduced and supporting viewers could implement the new transparency model and old viewers could simply ignore it.

        Activity

        Hide
        Patrick Corless added a comment -

        The Following notes are from the PDF specification iso-3200.

        Starting with PDF 1.4, an annotation appearance may include transparency. If the appearance’s stream dictionary does not contain a Group entry, it shall be treated as a non-isolated, non-knockout transparency group. Otherwise, the isolated and knockout values specified in the group dictionary (see 11.6.6, “Transparency Group XObjects”) shall be used.

        The transparency group shall be composited with a backdrop consisting of the page content along with any previously painted annotations, using a blend mode of Normal, an alpha constant of 1.0, and a soft mask of None.

        NOTE 1
        If a transparent annotation appearance is painted over an annotation that is drawn without using an appearance stream, the effect is implementation-dependent. This is because such annotations are sometimes drawn by means that do not conform to the PDF imaging model. Also, the effect of highlighting a transparent annotation appearance is implementation-dependent.

        Also the following notes for markup annotations:

        (Optional; PDF 1.4) The constant opacity value that shall be used in painting the annotation (see Sections 11.2, “Overview of Transparency,”and 11.3.7, “Shape and Opacity Computations”). This value shall apply to all visible elements of the annotation in its closed state (including its background and border) but not to the pop-up window that appears when the annotation is opened.
        The specified value shall not used if the annotation has an appearance stream (see 12.5.5, “Appearance Streams”); in that case, the appearance stream shall specify any transparency. (However, if the compliant viewer regenerates the annotation’s appearance stream, it may incorporate the CA value into the stream’s content.)
        The implicit blend mode (see 11.3.5, “Blend Mode””) is Normal. Default value: 1.0.
        If no explicit appearance stream is defined for the annotation, it may bepainted by implementation-dependent means that do not necessarily conform to the PDF imaging model; in this case, the effect of this entry is implementation-dependent as well.

        Show
        Patrick Corless added a comment - The Following notes are from the PDF specification iso-3200. Starting with PDF 1.4, an annotation appearance may include transparency. If the appearance’s stream dictionary does not contain a Group entry, it shall be treated as a non-isolated, non-knockout transparency group. Otherwise, the isolated and knockout values specified in the group dictionary (see 11.6.6, “Transparency Group XObjects”) shall be used. The transparency group shall be composited with a backdrop consisting of the page content along with any previously painted annotations, using a blend mode of Normal, an alpha constant of 1.0, and a soft mask of None. NOTE 1 If a transparent annotation appearance is painted over an annotation that is drawn without using an appearance stream, the effect is implementation-dependent. This is because such annotations are sometimes drawn by means that do not conform to the PDF imaging model. Also, the effect of highlighting a transparent annotation appearance is implementation-dependent. Also the following notes for markup annotations: (Optional; PDF 1.4) The constant opacity value that shall be used in painting the annotation (see Sections 11.2, “Overview of Transparency,”and 11.3.7, “Shape and Opacity Computations”). This value shall apply to all visible elements of the annotation in its closed state (including its background and border) but not to the pop-up window that appears when the annotation is opened. The specified value shall not used if the annotation has an appearance stream (see 12.5.5, “Appearance Streams”); in that case, the appearance stream shall specify any transparency. (However, if the compliant viewer regenerates the annotation’s appearance stream, it may incorporate the CA value into the stream’s content.) The implicit blend mode (see 11.3.5, “Blend Mode””) is Normal. Default value: 1.0. If no explicit appearance stream is defined for the annotation, it may bepainted by implementation-dependent means that do not necessarily conform to the PDF imaging model; in this case, the effect of this entry is implementation-dependent as well.
        Hide
        Patrick Corless added a comment - - edited

        In short we will need to extend the annotation tools to keep track of any alpha values set by the colour picker and update each implementation of Annotation.resetAppearanceStream() to properly create a needed external graphics state and the respective /CA and /ca values for stroking and none stoking alpha values. Stoke values would apply to border colour and non-stroking would apply to background colour values.

        Show
        Patrick Corless added a comment - - edited In short we will need to extend the annotation tools to keep track of any alpha values set by the colour picker and update each implementation of Annotation.resetAppearanceStream() to properly create a needed external graphics state and the respective /CA and /ca values for stroking and none stoking alpha values. Stoke values would apply to border colour and non-stroking would apply to background colour values.
        Hide
        Patrick Corless added a comment -

        Quite a bit of work has been done to add opacity support to to the markup annotation tools. This includes highlight, strikeout, underline, line, arrow, square, circle, ink, free text and text annotations. A new transparency input slider has been added to the properties panels for the previously mentioned annotation types. The slider allows the setting of the opacity paint value for both stroking and non-stroking operations effectively allowing the entire annotations appearance stream's opacity to be altered.

        Show
        Patrick Corless added a comment - Quite a bit of work has been done to add opacity support to to the markup annotation tools. This includes highlight, strikeout, underline, line, arrow, square, circle, ink, free text and text annotations. A new transparency input slider has been added to the properties panels for the previously mentioned annotation types. The slider allows the setting of the opacity paint value for both stroking and non-stroking operations effectively allowing the entire annotations appearance stream's opacity to be altered.
        Hide
        Patrick Corless added a comment -

        6.1.0 development branch has been updated as well as the trunk.

        Show
        Patrick Corless added a comment - 6.1.0 development branch has been updated as well as the trunk.
        Hide
        Patrick Corless added a comment -

        Marking as fixed .

        Show
        Patrick Corless added a comment - Marking as fixed .

          People

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

            Dates

            • Created:
              Updated:
              Resolved: