Expand my Community achievements bar.

Applications for the 2024-2025 Adobe Experience Manager Champion Program are open!
SOLVED

AEM forms Workbench : Flatten PDF form issues with hidden fields and buttons

Avatar

Level 1

Hi all,

 

We created a PDF form with workbench and designer (version 6.5).  After the form is submitted we want to send the pdf read only and flatten to other systems in our company.

I have written following code to flatten the pdf form :

 

private static OutputClient outClient;

public static void main(String[] args) throws Throwable {

try {

LCConnectionManager.setDefaultEnvironment(Environment.DEPLOY);
outClient = LCConnectionManager.instance().getOutputClient();

if (args.length == 2) {

//Reference an interactive PDF document to transform
FileInputStream fileInputStream = new FileInputStream(args[0]);
Document inPDFDoc = new Document(fileInputStream);

//Transform the PDF document to a non-interactive PDF document
Document transformedDocument = outClient.transformPDF(inPDFDoc, TransformationFormat.PDF, null, null, null);

//Save the non-interactive PDF document

File myFile = new File(args[1]);

transformedDocument.copyToFile(myFile);

}
} catch (Throwable t) {
throw t;
}

}

 

This works, the form is flatten.  But when we hide buttons and fields while filling in the form or just before submitting the form, all the hidden fields and buttons are visible in the flatten pdf.  So the method transformPDF of the OutputClient class doesn't see which parts are set to hidden on the submitted form.

 

Can anyone give some advice on this, which method should I use, are there alternatives ?

1 Accepted Solution

Avatar

Correct answer by
Employee

I am also able to reproduce the issue in my 6.5.11 AEM Forms JEE server. Can you please log a Support case for this issue, so that it can be investigated further? Thanks!

View solution in original post

1 Reply

Avatar

Correct answer by
Employee

I am also able to reproduce the issue in my 6.5.11 AEM Forms JEE server. Can you please log a Support case for this issue, so that it can be investigated further? Thanks!