Multiple PDF after form submit | Community
Skip to main content
hitesh_m
Level 3
January 27, 2016
Solved

Multiple PDF after form submit

  • January 27, 2016
  • 9 replies
  • 2089 views

We are using AEM Forms and for one of the critical business requirement we need following answers

1. Can multiple PDFs be generated after we submit an AEM form ?  Example, a form has 3 fields.  Upon submit, PDF#1 is generated with all 3 fields and PDF#2 is generated with only fields #2+3.  PDF#1 is sent to email address #1 and PDF#2 sent to email address #2.  Is this possible with AEM Forms out-of-the-box?  If not, is it possible through customization?  Any direction would be very beneficial.

 

2. If its not possible through AEM form component, whats the alternative and how other AEM users solving the issues like that. 

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

Here are some useful links on this use case: 

If there is an XDP then the data will be merged and the PDF stored or emailed.

https://helpx.adobe.com/aem-forms/6-1/configuring-submit-actions.html#Configuring%20the%20Store%20PDF%20action%20submit%20action

If they don’t want to design an XDP and want a document of record.

https://helpx.adobe.com/aem-forms/6-1/generate-document-of-record-for-non-xfa-based-adaptive-forms.html

9 replies

smacdonald2008
Level 10
January 27, 2016

What AEM version are you using? You interested in using adaptive forms? Your use case would require a custom implementation but this depends upon the version you are using.

hitesh_m
hitesh_mAuthor
Level 3
January 27, 2016

Thanks for your reply. 

We are using Adaptive forms in AEM 6.1 

Amit_Kumar
Level 10
January 28, 2016
smacdonald2008
Level 10
January 28, 2016

We support this - I will link to how to docs and video soon. 

smacdonald2008
smacdonald2008Accepted solution
Level 10
January 28, 2016

Here are some useful links on this use case: 

If there is an XDP then the data will be merged and the PDF stored or emailed.

https://helpx.adobe.com/aem-forms/6-1/configuring-submit-actions.html#Configuring%20the%20Store%20PDF%20action%20submit%20action

If they don’t want to design an XDP and want a document of record.

https://helpx.adobe.com/aem-forms/6-1/generate-document-of-record-for-non-xfa-based-adaptive-forms.html

hitesh_m
hitesh_mAuthor
Level 3
January 28, 2016

I dont think we are looking for this solution. We know that PDF can be sent by AEM Form out of the box. Our case is a bit different

" Example, a form has 3 fields.  Upon submit, PDF#1 is generated with all 3 fields and PDF#2 is generated with only fields #2+3.  PDF#1 is sent to email address #1 and PDF#2 sent to email address #2.  Is this possible with AEM Forms out-of-the-box?  If not, is it possible through customization? " 

After submitting a form a PDF is sent in AEM by "Email PDF Action". But, we have to sent two PDFs.  

smacdonald2008
Level 10
January 28, 2016

Then use the AEM Document Service APIS to create a PDF and then in your OSGi logic - email them or what ever you need to do. Writing a custom service - you can develop the  logic to handle the PDF to meet your business requirements. I am going to write a communtiy article on this use case. 

smacdonald2008
Level 10
January 28, 2016

See: https://helpx.adobe.com/aem-forms/6-1/aem-document-services-programmatically.html

So to summarize - you need to develop a custom OSGi service that uses the AEM Document Service APIs and dynamically create the PDF with submitted form data. Then you can have logic to email the PDFs. All this can be done via a custom AEM service and the APIs listed above. I wish I had a communtiy artilce to point you to for this - but as of now - there is not one. Only the AEM forums article that talks about posting Adaptive Form data to an OSGi that i listed in a previous response. 

Amit_Kumar
Level 10
January 28, 2016

Hi Hitesh,

@smacdonald2008 told you that it is possible with the help of existing API and services.

As i had mentioned that you have to create a new submit action type i.e. sendThreeEmails.

and You can refer to the above links for

1. How to create a custom submit action.

2. How to send PDF on submit action.

Now You can create as many PDF as you want using this information.

I don't Understand What do you want more.

Regards,

Amit