开发者

Find existing PushbuttonField in PDF document using iText

开发者 https://www.devze.com 2023-03-02 03:53 出处:网络
I am using the Java iText library to manipulate form fields of a PDF document and have run into a simple problem.I am able to set properties of AcroFields that I retrieved from a PdfStamper object how

I am using the Java iText library to manipulate form fields of a PDF document and have run into a simple problem. I am able to set properties of AcroFields that I retrieved from a PdfStamper object however what I really want to do is set an Action to an existing push button field.

I have found countless examples of creating a new PushButton field and adding it to a document, however none that actually retrieve an existing PushbuttonField object. I am sure that is the correct object because it has a setAction method where the AcroField object does not.

I am willing to accept that it is impossible because I could work around this by using Acrobat to remove the button from the template and then programatically adding it fresh everytime.

Further I woul开发者_如何学JAVAd like to know if anybody knows of a more comprehensive location for documentation on iText. Incomplete javadocs and specific code examples don't make for the best documentation.


You need to know the name of the pushbuttonfield to retrieve it. Take a look at the example to see how to retrieve, adjust and replace.

You can set actions if you have the PushbuttonField#getField()#setAction()

0

精彩评论

暂无评论...
验证码 换一张
取 消