Generate AFP Output Using the AEM Forms API

This is a pre-release feature and accessible through our pre-release channel.

Advanced Function Presentation (AFP) is a high-performance document format designed primarily for printing purposes.
This guide outlines all necessary steps and configurations to generate AFP output using AEM Forms.

AFP Generation API

Generates an AFP (Advanced Function Presentation) file using an XDP template and input data.

Authorization

You can either use BasicAuth (Admin credentials) for local environments or BearerAuth authorization for AEM Cloud instances.

Request

Endpoint:
POST http://<server>:<port>/adobe/forms/document/generate/afp

Headers

Key
Value
Content-Type
application/pdf
Authorization
(Bearer Access token)

Request Body

Content-Type: multipart/form-data

Key
Type
Required
Description
template
File/Text
Yes
XDP file used as the template for AFP generation (e.g., demo.xdp)
data
File/Text
No
Data file (XML or JSON) to be merged with the template (e.g., data.xml)
options
Text
No
JSON string with options to control AFP output (e.g., resolution, locale)

Example options JSON (Text field):

{
  "pdfVersion": "1.7",
  "resolution": 300,
  "locale": "en-US",
  "embedFonts": true,
  "contentRoot": "/usr/tmp"
}

Responses

Code
Description
200
Operation successful. Returns the AFP document stream.
400
Bad Request. The request payload is malformed or missing required fields.
500
Internal Server Error. Try again after some time.

Curl Command

curl --location 'http://<server>:<port>/adobe/forms/document/generate/afp' \
--header 'Authorization: Bearertoken <base64-encoded-credentials>' \
--form 'template=@"<path-to-template>.xdp"' \
--form 'data=@"<path-to-data-file>.xml"' \
--form 'options=<JSON-options-string>'

Testing the API

You can download the .yaml file and upload it to Postman to check functionality of the APIs.

AFP Postman image

You can save the response and open the saved file in AFP reader to view it.

Find IC Docu

recommendation-more-help
fbcff2a9-b6fe-4574-b04a-21e75df764ab