dlex-layout
Use the dlex-layout endpoint to create PDF reports from DLEX files created using Designer.
The dlex-layout
endpoint creates PDF reports from DLEX files. The endpoint consists of two form field parameters and returns a PDF document.
Refer to dlex-layout in the Client Libraries Users Guide section for this example using the DynamicPDF API's client libraries.
Request/Response
Request | Request Body | Response |
---|---|---|
POST | multipart/form-data | PDF as a byte-array |
The dlex-layout
endpoint uses a DLEX file combined with JSON data to create PDF reports. It is an HTTP POST command that submits a form. The form fields consist of the following:
DlexPath
- the path to the DLEX file in your cloud storage space (access using the File Manager), andLayoutData
- the path to the JSON layout data on your local system.Resource
- the path to a local DLEX file, and any associated resources.
A DLEX file can be in your cloud storage space or in your local filesystem. If in cloud storage, use DlexPath
otherwise use Resource
.
curl https://api.dpdf.io/v1.0/dlex-layout
-H "Authorization:Bearer DP.xxx-api-key-xxx"
-F "DlexPath=samples/dlex-layout/SimpleReportWithCoverPage.dlex"
-F "LayoutData=@C:/temp/SimpleReportWithCoverPage.json"
-o simple-report.pdf
Realize you are not limited to LayoutData
being a file. An HTTP POST command converts a file into a byte-array and then streams the byte-array to the calling REST endpoint.
Parameters
All calls to the endpoint must provide the JSON dataset for the DLEX file through the LayoutData
parameter. The DLEX file can come from DynamicPDF API cloud storage or from your local file system.
If the DLEX comes from DynamicPDF API cloud storage, then any resources embedded in the DLEX must reside on cloud storage. If the DLEX comes from your local system, then any resources embedded in the DLEX must reside on your local sysem.
Parameters | Type | Description | |
---|---|---|---|
Form Field | |||
DlexPath | string | The path to the DLEX file in your cloud storage space used to generate PDF. | REQUIRED |
-OR- | |||
Resource | file | The DLEX file on your local system. | REQUIRED |
Resource | file | A local resource embedded in local DLEX file. | |
-AND- | |||
LayoutData | file | The JSON layout data used with DLEX file to generate PDF. | REQUIRED |
Header | |||
Authorization | Bearer DP.V9xxxx | The API key. | REQUIRED |
The LayoutData
is multipart/form-data; to generate layout data dynamically, programmatically call the endpoint.
Example cURL Request
curl https://api.dpdf.io/v1.0/dlex-layout
-H "Authorization:Bearer DP.xxx-api-key-xxx"
-F "DlexPath=simplereport.dlex"
-F "LayoutData=@C:/mylayoutdata.json"
-o simple-report.pdf
Further Information
You can also use one of DynamicPDF's provided client libraries to integrate the endpoints into your client applications if you prefer. For more information, refer to the relevant Users Guide sections:
- DynamicPDF API's Endpoints - (cloud-api-overview), and
- DynamicPDF API's Client Libraries - (cloud-api-client-libraries).