I have a PDF template (designed using Adobe Livecycle designer), that has a subform and a textfield. The properties of those two objects is set to float
. And the height of those objects is set to Autofit
. All the enclosing parents heights of these objects were set to AutoFit
.
My intention here is to increase the textfield height depending on the text content we enter into the textfield.
When I preview the template from the Adobe designer, the generated preview PDF, displays the textfield as floating (based on the test data I entered).
For our application purposes, we use iText.
Basically, we load these predefined templates, and fill in the data into those fields using iText API.
The current version of iText we use is iText 5.1.3
...
Document document = new Document();
document.open();
PdfReader reader = new PdfReader(<inputTemplate>);
ByteArrayOutputStream aStream2 = new ByteArrayOutputStream();
PdfStamper stamper2 = new PdfStamper(reader, aStream2);
AcroFields form = stamper2.getAcroFields();
form.setField("<fieldname>", "<fieldvalue>");
...
and so on.
The PDF thus generated displays only text that fits into the size of the textbox, basically ignoring to overflow.
Hopefully, I have given enough description of the problem I am encountering. I want to dynamically embed the content and make rest of the PDF floatable. I wonder how else I can acheive this using iText?