Opacity for annotation objects

Yan Wong
  • Yan Wong

    Yan Wong - 2013-02-23

    In Acrobat Reader I can set the opacity of the fill colour for annotation objects such as squares, ellipses, and polygons. Is there a way to set this opacity in pdfclown, or to simulate it by setting alpha values for the layer. The watermark sample shows how to apply transparency to a standard content composer, but I'm not sure that applies to annotations.



  • Stefano Chizzolini

    Hi Yan,

    because of your request, I've just committed on the SVN repo (rev 100) the support to markup annotation properties.

    If you don't want to checkout the SVN trunk, you can apply opacity this way:

    import org.pdfclown.documents.interaction.annotations.Rectangle;
    . . .
    Rectangle rectangle = . . .
    // NOTE: opacity is between 0 and 1
    double alpha = .25;
    rectangle.getBaseDataObject().put(PdfName.CA, PdfReal.get(alpha));

    thank you

  • Yan Wong

    Yan Wong - 2013-02-25

    Wow - that's an amazingly fast response. Thanks a lot for this. I should say that I'm also very impressed by your dedication in providing pdfClown.


Log in to post a comment.