Hello

 

I try to add hidden AcroFields to existing pdf documents.

 

// Create Acrofields with number of stamps

PdfFormField stampfield =
PdfFormField.createTextField(stamp.getWriter(),

true, // multiline

            false, // password

            0); // Maxlength of field - 0 = unlimited

stampfield.setFieldName("my_field");

stampfield.setValueAsString("my_value");

stampfield.setFieldFlags(TextField.HIDDEN);

stamp.addAnnotation(stampfield, 1); //
stamp.getWriter().addAnnotation(stampfield) gaves an exception for wrong
use....

 

 

On stamped pdf I can see with text editor that "" with "my_value" have
been written. But if I open the pdf document again with PdfReader and ..

 

AcroFields acroFields = inPdf.getAcroFields();

String myvalue = acroFields.getField("my_field"); // returns null

 

.. I can not get "my_field".

 

What did I wrong? How can I get my acrofields?

 

Maybe a hint: On the book "iText in action", Chapter 15 I found how to
add AcroField with PdfWriter (but there is no example for PdfStamper);
In Chapter 16 I found how to modify existing AcroFields with PdfStamper
(but no example how to add a new field).

 

Thanks in advance.

Sascha

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to