How to click a button in PDF form with iText? -


i have fill pdf form data. form contains few tables "add" button adds new row inputs table, example "foreign patent documents". need "click" button in code using itext few times, add necessary rows, input names there , fill them. how can itext? provide me code example?

my pdf file form https://drive.google.com/open?id=0bwtwu1543ebtq3a3b2dzcw9qyk0

this file predefined , can't regenerate it.

you don't "click" button programmatically. provide data necessary, , form adapt.

see fillxfa example. have purchase_order.pdf looks this:

enter image description here

this document has "add item" button add more line items (which results in creating more pages if necessary). button makes sense if there's gui, when fill out form programmatically, there aren't buttons push. provide xml data (e.g. data.xml), this:

public void manipulatepdf(string src, string dest)     throws ioexception, documentexception {     pdfreader reader = new pdfreader(src);     pdfstamper stamper = new pdfstamper(reader,             new fileoutputstream(dest));     acrofields form = stamper.getacrofields();     xfaform xfa = form.getxfa();     xfa.fillxfaform(new fileinputstream(xml));     stamper.close();     reader.close(); } 

the result looks this: purchase_order_filled.pdf

enter image description here

as can see, multiple lines added, without pushing button.

important: see have hybrid document. think should make pure xfa form. code won't work if keep acroform fields.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -