hichiu,

hichiu wrote
> it works with ...

Great.

> but the free text is removed. If i dont add "
> comment.Remove(PdfName.CONTENTS);", the annotation modified is shown
> again. Moreover, the annotation is not showing, both the color and the
> text.

Of course. You create the appearance. And that includes writing the text
there; and drawing a frame; and painting flowers in the background if
required. ;)

In my experiments (Java) I did it like this:

        PdfAppearance highlight_ap =
canvas.createAppearance(annotRect.getWidth(), annotRect.getHeight());
        highlight_ap.setColorFill(BaseColor.MAGENTA); 
        highlight_ap.setColorStroke(BaseColor.BLUE); 
        highlight_ap.beginText();
        highlight_ap.setFontAndSize(BaseFont.createFont(), 11);
        highlight_ap.setTextMatrix(0, 2);
        highlight_ap.showText("The case is reviewed and approved.");
        highlight_ap.endText();
        comment.setAppearance(PdfName.N, highlight_ap);

which resulted in:  test_signed-with-freetext.pdf
<http://itext-general.2136553.n4.nabble.com/file/n4659446/test_signed-with-freetext.pdf>
  

Quite likely you will want to use a different font, or position the text
differently, or draw some frame around it, or ..., or ..., or ...

Regards,   Michael



--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/Itextsharp-annotations-modified-after-digital-signing-tp4659401p4659446.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
Free app hosting. Or install the open source package on any LAMP server.
Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to