REST API Features/Documentation Confirmation

New Here ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

Hello,

 

I have recently discovered about the PDF generated REST APIs from Adobe and have some likely pretty basic questions that I need to answered before I go down this path.

I would like to generate a PDF based from a template and JSON calling a REST API which I understand is supported here: https://documentcloud.adobe.com/document-services/index.html.  Furthermore, I will also need to Merge different PDF docs into 1 PDF.  I would be using something like Mulesoft with a REST connector to make the REST API calls.

A few questions:

I understand that these REST APIs are "new" so I wanted to confirm that the above requirements are possible (which I believe it is)?

Can I generate the template from Adobe Life Cycle or does it have to be from the Document Generation Add-on for Microsoft Word?

Will calling the documentGeneration POST return the generated PDF in the response?  Likewise for merging with call for combinePDF POST.

Are there any blogs/samples code where the REST API is being called?  I've only seen samples of the JAVA/Node js/.Net

 

Thanks in advance!

 

Views

240

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

Hi @Jeff5C0B ,

 

Here are my answers below.

I would like to generate a PDF based from a template and JSON calling a REST API 

Absolutely possible using Adobe Document Generation API. You would create your template in DOCX format. You can pass the JSON data and the template to the API and it will return a PDF or Word document. Note, the Adobe Document Generation Tagger is a convenience for tagging your documents, but you don't technically NEED to use it. You can learn the tagging structure here. 

You can learn more about that here.

 

I will also need to merge different PDF docs into 1 PDF

Also possible. In this case you would use the Combine PDF API. 

 

Can I generate the template from Adobe Life Cycle or does it have to be from the Document Generation Add-on for Microsoft Word?

Adobe LiveCycle end of life-d in 2019. Most of that functionality is now part of Adobe Experience Manager Forms. Adobe Document Generation API does not support templates that were created in LiveCycle. You can certainly convert your PDF form into a Word document and use Adobe Document Generation that way, but not the XFA PDF natively. Templates created by LiveCycle (XFA) were a bit different than conventional PDFs. You can do that using Adobe Acrobat or using Export PDF API to convert it into Word.

 

Will calling the documentGeneration POST return the generated PDF in the response?  Likewise for merging with call for Combine PDF POST.

If you have a look at the Postman collection of Adobe Document Generation API, you'll see there is a call for authentication, to post the data, and a Poll action to download the result. You can definitely take the result of that and then use it within a Combine PDF step.

 

Are there any blogs/samples code where the REST API is being called?

REST APIs are new and we will be blogging about it soon on Adobe Tech Blog. In the mean time, there are sample Postman collections and documentation. 

 

Feel free to keep the conversation going on here. Love to understand how your progress goes as you are looking to do this with MuleSoft. 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

Thank you very much Ben for your responses!  

I was able to progress with postman today leveraging the published collection and got a test working using a docx template so happy to see this.

 

Question that may be an issue is that the Mule application will be deployed in the cloud (cloudhub) and as such doesn't have a physical file system.  Can I stream/send just the contents of the template file somehow instead of referencing a physical location file?  We would probably only be able to do something like reading from an FTP server to get the docx from on-premise to then run it through the Mule application.

 

Also, how long does the generated docs stay in your system and accessible?

 

Thanks in advance and also will be keeping an eye out on your Adobe Tech blog.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

The Poll response that you get in the Postman collection should provide back a response that is a multi-part response. The first part is the JSON data response with metadata. The second part should be the data strem of the PDF content, so there should be no reason you need to write to a file system in order to get the response. 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 13, 2021 Apr 13, 2021

Copy link to clipboard

Copied

LATEST

Sorry if I wasn't clear, but I was referring to the POST Document Generation call where it references the docx template file for the inputFile0.  Am I able to call this API with streamed docx template content instead of referencing a physical file location?

 

Thanks!

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources