I have tried the following and it did not do any better, I am still not
getting the data across to my swf that is embedded in the pdf.


TextField tf = new TextField(writer, new Rectangle(1,1,1,1), "Data");
        tf.setVisibility(TextField.HIDDEN);
        PdfFormField field = null;
        try {
            field = tf.getTextField();
        } catch (IOException e) {
            e.printStackTrace();  //To change body of catch statement use
File | Settings | File Templates.
        } catch (DocumentException e) {
            e.printStackTrace();  //To change body of catch statement use
File | Settings | File Templates.
        }
        writer.addAnnotation(field);
        return table;


Later on I set the xml data using:

AcroFields form = stamper.getAcroFields();

form.setField("Data", dataString);
stamper.close();                reader.close();




Sanjeev Sharma
Technical Leader

15455 Dallas Parkway                   Tel:  (972) 759-4289
Suite 600                                       Mob:(469) 865-3537
Addison, TX 75001                         Fax: (972) 764-3224
http://www.infovista.com <http://www.infovista.com/>





On 8/11/11 10:38 AM, "1T3XT BVBA" <[email protected]> wrote:

>On 11/08/2011 17:24, Sanjeev Sharma wrote:
>> Now in order to have this Data field in the PDF - I need to be able to
>>add
>> a field to the PDF that I am creating from scratch and here is what I
>>did:
>> PdfFormField field = new PdfFormField(writer,
>> 0.0f,0.0f,104.08f,31.4f,PdfAction.createHide("data", true));
>>          field.setName("Data");
>>          writer.getAcroForm().addFormField(field);
>>
>>
>> The above code did not achieve the purpose and hence I am pinging you.
>
>I completely understand why this doesn't work.
>Apparently you ignored my previous answer:
>
>> On 8/11/11 1:05 AM, "1T3XT BVBA"<[email protected]>  wrote:
>>
>>> >I would use a text field and set its visibility to hidden.  The
>>>setVisibility() method is explained on p246.You need TextField.HIDDEN
>>>as parameter.
>
>Did you try implementing that suggestion? I don't see you using the
>TextField class, I don't see you using the setVisibility() method, I
>don't see you adding the field to the writer as explained in the book.
>
>--------------------------------------------------------------------------
>----
>Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
>user administration capabilities and model configuration. Take
>the hassle out of deploying and managing Subversion and the
>tools developers use with it.
>http://p.sf.net/sfu/wandisco-dev2dev
>_______________________________________________
>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


------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
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