I think I have come closer to the final aim with the foll code, but I
strongly feel that some tiny bit is missing...can anyone pls help - i think
im not getting the right PdfName in the setAppearance method...the
documentation is bit confusing - i have done some amount of trial and error,
but no luck so far....

                BaseFont bf = BaseFont.createFont (BaseFont.COURIER,
BaseFont.CP1252, BaseFont.NOT_EMBEDDED);

                PdfAppearance ap =
writer.getDirectContent().createAppearance(rect.getWidth(),
rect.getHeight());

                ap.beginText();
                ap.setFontAndSize(bf, 10);
                ap.showText(contents.getContent());
                ap.endText();

                pa.setAppearance(PdfName.AS, ap);
                writer.addAnnotation(pa);


thx in advance

On Wed, Oct 5, 2011 at 5:12 PM, 1T3XT BVBA <[email protected]> wrote:

> On 5/10/2011 13:04, Manoj Karnavat wrote:
> > PdfDictionary appear = new PdfDictionary();
> >                 appear.put(PdfName.AC, str);
> What's this? Is str a (Pdf)String object? That's not an appearance, is it?
> If you want an appearance, you need to create the PDF syntaxt to draw it
> using methods such as beginText(), setFontAndSize(), showText(), endText()
>
>
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> iText-questions mailing list
> [email protected]
> 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
>
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
iText-questions mailing list
[email protected]
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