pdf-issues icon indicating copy to clipboard operation
pdf-issues copied to clipboard

Proposal to Support Independent Text Opacity Settings for FreeText Annotations

Open AmyLin2013 opened this issue 1 year ago • 3 comments

I would like to propose an enhancement to the PDF 2.0 annotation specification, particularly regarding the opacity settings for FreeText annotations. Currently, in the PDF 2.0 specification, the /ca dictionary entry for annotations controls the opacity of all nonstroking elements, such as the background and border. However, there are cases where we would like to set the opacity of the text content independently of other elements like the border and fill color.

For example, imagine a scenario where we want to add a text box with the following characteristics:

  • The border of the text box is fully opaque (100% opacity).
  • The fill color of the text box has 10% transparency.
  • The text itself needs to remain fully opaque (100% opacity).

Under the current specification, there is no way to achieve this effect because the opacity setting applies uniformly to all nonstroking elements. This limits the flexibility in creating annotations where different elements need different transparency levels.

I suggest adding the ability to independently control the opacity of the text content in FreeText annotations, allowing for more precise control over the appearance of annotations, especially in use cases where varying transparency levels for different elements are required.

Thank you for considering this proposal. I believe this feature would enhance the usability and visual flexibility of PDF annotations.

AmyLin2013 avatar Dec 26 '24 09:12 AmyLin2013

The current specification allows for achieving different opacity effects by individually controlling the AP stream during the generation of the text stream. However, without a dedicated dictionary entry, it becomes challenging to maintain the same opacity settings when editing the FreeText annotation for the second time. Therefore, I suggest that the PDF specification consider adding a dedicated dictionary entry for the opacity of text objects within FreeText annotations. This enhancement would ensure consistent and predictable behavior during annotation edits, improving both functionality and user experience.

AmyLin2013 avatar Dec 27 '24 07:12 AmyLin2013

Re "maintain[ing] the same opacity settings when editing the FreeText annotation for the second time": it has been discussed previously that the (re-)generation of annotation appearance streams needs explaining somewhere. The current view is that this should not be in ISO 32000, but a separate PDF Association publication such as an application note or tech note. There are also other errata highlighting this.

petervwyatt avatar Jan 02 '25 04:01 petervwyatt

PDF 2.0 has both a ca and CA for annotations - one for context (text in the case of the FT annot) and one for how to merge the annot into the page itself. I don't think we need a 3rd.

lrosenthol avatar Apr 30 '25 19:04 lrosenthol