I am now writing the text by using the PdfContentByte object. But I am
unable to put all the pieces together... how do i connect the above
PdfContentByte and the dictionary object - i dont see any method to link
these 2 objects

                PdfContentByte canv = canvas[PdfPTable.TEXTCANVAS];

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

                PdfString str = new PdfString(contents.getContent());
                canv.setFontAndSize (bf, 10);

                canv.saveState();
                canv.beginText();
                canv.showTextAligned(Element.ENTITY_NODE,
contents.getContent(), rect.getLeft(), rect.getBottom(),0);
                canv.endText();
                canv.restoreState();

                PdfDictionary appear = new PdfDictionary();
                appear.put(PdfName.AC, ???);
                pa.put(PdfName.MK, appear);
                writer.addAnnotation(pa);

Thanks for the guidance


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