Expand my Community achievements bar.

SOLVED

Multiple PDF after form submit

Avatar

Level 3

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. 

1 Accepted Solution

Avatar

Correct answer by
Level 10

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%20PD...

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.h...

View solution in original post

9 Replies

Avatar

Level 10

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.

Avatar

Level 3

Thanks for your reply. 

We are using Adaptive forms in AEM 6.1 

Avatar

Level 10

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

Avatar

Correct answer by
Level 10

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%20PD...

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.h...

Avatar

Level 3

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.  

Avatar

Level 10

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. 

Avatar

Level 10

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. 

Avatar

Level 10

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