HI All,

*Problem:* On a base pdf I want to stamp some user info for ex: Name
*Limitation:* To avoid the "Cannot Save Form Information Warning".

If I create a textfield field (using AcroForm or XFAForm) then on opening
the pdf in reader I get the "Cannot Save Form" warning.

*To avoid the warning I have created buttons on the base pdf using Acrobat
and trying to replace the button displayText with the userName using iText
2.*

CodeSnippet:
AcroFields acroForm = pdfStamper.getAcroFields();
HashMap fieldMap = acroForm.getFields();
for (Iterator iterator = fieldMap.keySet().iterator(); iterator.hasNext();)
{
   String key = (String) iterator.next();
   AcroFields.Item item = (AcroFields.Item)fieldMap.get(key);
   switch (acroForm.getFieldType(key)) {
     case AcroFields.FIELD_TYPE_PUSHBUTTON:
       String fieldValue = acroForm.getField(key);
       System.out.println(*acroForm.setField(key, fieldValue, "harshit")*);
       break;
     default:
       System.out.println("OK");
  }
}


*Is it possible to replace the button display text (caption) ? If yes plz
correct me in the codesnippet or help me with a link or sample code.*



-- Harshit Bapna
------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to