Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.

how to read form field values from adobe live cycle manager in java

Avatar

Level 2

I created a pdf using Adobe acrobat DC and able to read values using below code.

PdfReader pdfReader = new PdfReader(filePath);

        AcroFields acroFields = pdfReader.getAcroFields();

        Map<String, AcroFields.Item> fields = acroFields.getFields();

        Map<String, String> fieldsMap = new HashMap<>();

        for (Entry<String, Item> entry : fields.entrySet()) {

            fieldsMap.put(entry.getKey(), acroFields.getField(entry.getKey()));

        }

But when i created a pdf using Adobe Live Cycle Manager the above code is not working when i try to read the form fields.

Please let me know how to read the form fields if we create a form using Adobe LiveCycle Manager.

3 Replies

Avatar

Level 5

Hi,

When you create a form using LiveCycle, it does not create an AcroForm, it creates an XFA (XML) form. You can read here about the differences, but it boils down to you cannot access the fields in an XFA form using AcroFrom methods.

What is the difference between AcroForms and XFA? – Appligent

Regards

Malcolm

Avatar

Level 2

Thanks for your reply.

Can you please share the examples which contains how to read from form and write into form(created by Adobe LiveCycle Designer) in java.

Avatar

Level 2

Hi,

I created a template using AEM forms designer. And my input is Map with key, value pairs. And i need java code to pass these values to template and generate a pdf.

Can you please help on this.