Hi,

I'm trying to fill a form  and I'm going to flatten the fields. I use
the following code

        try(var fis = new FileInputStream("/tmp/test.pdf");
                var fos = new FileOutputStream("/tmp/pippo.pdf")) {

            PDDocument doc = Loader.loadPDF(new RandomAccessReadBuffer(fis) );
            PDAcroForm form = doc.getDocumentCatalog().getAcroForm(null);
            PDField field = form.getField("nome");
            field.setValue("Luca");
            var toBeFlatten = new ArrayList<PDField>();
            toBeFlatten.add(field);
            form.flatten(toBeFlatten, true);

            doc.save(fos);
            doc.close();
        }

If I use the test.pdf (attachmed), I obtain wrong space between
letters (see test.png attachment).

I think that the problem is in the font attached, the chars width
table has only 5 entries (see chars_width.png attached).

Can I do something to obtain the correct space?

Thanks,
Luca

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: users-h...@pdfbox.apache.org

Reply via email to