Expand my Community achievements bar.

Form submission and generate pdf in AEM as cloud service

Avatar

Level 4



HI Team,
We have a requirement to update an HTML form, and upon submission, a PDF needs to be generated based on the form values. I have tried uploading the PDF to AEM DAM and was able to read the field values, but I am unable to update the PDF in AEM.

Which is the best approach to develop this feature ,


AEM as CS version 

Thanks in advance

2 Replies

Avatar

Level 5

Leveraging AEM Forms Add-On for PDF Generation

The AEM Forms Add-On provides built-in services and workflows to convert form data into PDFs effectively. If you plan to implement a custom solution, here are key considerations and steps:

Key Considerations for Custom Implementation in AEM

  •  Identify where the submitted form data is currently stored. CRX or external DB.
  • Handling Anonymous and Logged-In Users if the data is stored in CRX
    • For anonymous users:
      • Store the data under:
        /content/formname-data/anonymous/{submissionID}
    • For logged-in users:
      • Store the data under:
        /content/formname-data/{userID}/{submissionID}
  • You can create a component to configure the template for the PDF(e.g., headers, footers, body sections). This way we can reuse this for any other forms.
  • Create a service to generate PDFs dynamically from stored form data.

Avatar

Community Advisor

Hello @georhe6 ,

Instead of updating the pdf can't we generate the pdf using some library like (itextpdf) based on the submitted data? 

Thanks