Skip to main content

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.

info

Refer to dlex-layout in the Client Libraries Users Guide section for this example using the DynamicPDF API's client libraries.

Request/Response

RequestRequest BodyResponse
POSTmultipart/form-dataPDF 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), and
  • LayoutData - the path to the JSON layout data on your local system.
  • Resource - the path to a local DLEX file, and any associated resources.
info

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
info

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.

   Follow us on social media for latest news!
danger

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.

ParametersTypeDescription
Form Field
DlexPathstringThe path to the DLEX file in your cloud storage space used to generate PDF.REQUIRED
-OR-
ResourcefileThe DLEX file on your local system.REQUIRED
ResourcefileA local resource embedded in local DLEX file.
-AND-
LayoutDatafileThe JSON layout data used with DLEX file to generate PDF.REQUIRED
Header
AuthorizationBearer DP.V9xxxxThe API key.REQUIRED

Run In Postman

important

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: