How to fit long text inside text box using iText Java

23 Views Asked by At

I am generating one PDF and I want to fit long text inside of text box. Not getting idea How to fit long text inside of text area.

Suppose I am setting font size as 12 for text not if its long text then text is going out of the box. But instead of that may can we decrease the size and fit content inside of text box.

I have used below code

PdfAcroForm form = PdfAcroForm.getAcroForm(pdfDoc, false); form.getFormFields().get("address").setValue(streetAddress).setFontAndSize(smallNormalFont, 10);

enter image description here

AS you can see text are not fit into the text box its exceeded the text area.

Any help will appreciate

0

There are 0 best solutions below