Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void AddTextBoxEvent(string fieldName, PdfStamper stamper, string script)
- {
- var item = stamper.AcroFields.GetFieldItem(fieldName);
- if (item != null)
- {
- var dict = item.GetWidget(0);
- if (dict != null)
- {
- var aaDict = dict.GetAsDict(PdfName.AA);
- var action = PdfAction.JavaScript(script, stamper.Writer);
- if (aaDict == null) aaDict = new PdfDictionary();
- aaDict.Put(PdfName.F, action);
- dict.Put(PdfName.AA, aaDict);
- }
- }
- }
Add Comment
Please, Sign In to add comment