Guest User

Untitled

a guest
May 21st, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. private void AddTextBoxEvent(string fieldName, PdfStamper stamper, string script)
  2. {
  3. var item = stamper.AcroFields.GetFieldItem(fieldName);
  4. if (item != null)
  5. {
  6. var dict = item.GetWidget(0);
  7. if (dict != null)
  8. {
  9. var aaDict = dict.GetAsDict(PdfName.AA);
  10. var action = PdfAction.JavaScript(script, stamper.Writer);
  11. if (aaDict == null) aaDict = new PdfDictionary();
  12. aaDict.Put(PdfName.F, action);
  13. dict.Put(PdfName.AA, aaDict);
  14. }
  15. }
  16. }
Add Comment
Please, Sign In to add comment