Overview
The DynamicPDF API has several client libraries designed to make integrating the REST endpoints into your application much easier.
The DynamicPDF API has several client libraries designed to make integrating the REST endpoints into your application much easier. Depending upon your development environment, rather than developing your client application from scratch, consider using one of our client libraries to simplify your organization's development.
All resources are contained in the samples/users-guide-samples in your Resource Explorer. Some of these files you may need to download to use. See Sample Resources for instructions on adding sample resources.
Languages
- C#
- Go
- Java
- Node.js
- PHP
- Python
Libraries
Access the libraries from the DynamicPDF API github project at https://github.com/dynamicpdf-api. The client library for each respective language is also available for incorporation into your project via Nuget, Maven, npm, PIP, or Composer.
Note that most the client libraries also contain a test folder containing more examples illustrating using the relevant client api.
The following client libraries also have a test framework containing numerous examples illustrating how to use the API.
Refer to each client library's readme.md file on GitHub for documentation on the library.
Library | Installation |
---|---|
C# | Available on NuGet: Install-Package DynamicPDF.API |
Go | Available as a Go package: go get github.com/dynamicpdf-api/go-client |
Java | Available on Maven: <dependency><groupId>com.dynamicpdf.api</groupId><artifactId>dynamicpdf-api</artifactId><version>1.10.1</version></dependency> |
Node.js | Available on NPM: npm i @dynamicpdf/api |
PHP | Available using Composer: composer require dynamicpdf/api |
Python | Available using PIP: pip install dynamicpdf-api |
Underlying REST Client
Each client library uses an underlying REST client library.
Client Library | Underlying REST Client | Vendor URL |
---|---|---|
C# | RestSharp | https://restsharp.dev/ |
Java | REST-assured | REST-assured https://rest-assured.io/ |
Node.js | HTTP Module | node.js built-in HTTP module (https://nodejs.dev/learn/the-nodejs-http-module) |
PHP | cURL | https://curl.se/ |
Python | Requests HTTP Library | https://docs.python-requests.org/en/latest/ |
The Endpoint
class is the parent to all other endpoint related classes. If you need to use a different REST client, you can modify the Endpoint
class. However, the REST clients chosen by DynamicPDF API are all industry standard and robust.
General Processing Steps
When calling an endpoint using one of the client libraries, follow these steps to integrate the library with your application.
- First, create an instance of the resource from your local system.
- Next, create a new endpoint instance where you pass the resource from your local system.
- Set the instance's base URL and API key.
- After creating the endpoint instance, call its
process
method which calls the REST endpoint and returns the JSON response (orXML
if the endpoint isPdfXmp
).
Refer to the following Users Guide topic (Users Guide - Workflow) for more explanation describing the general workflow for using one of the DynamicPDF API Endpoints.
Endpoints
The following table lists the endpoint's associated class and constructor arguments. Note that the class names are consistent between client libraries. Also note that all endpoints, with the exception of DlexLayout
, use a resource from your local system.
Endpoint | Endpoint's Class Name | Constructor Arguments | Returns | Description |
---|---|---|---|---|
image-info | ImageInfo | ImageResource | JSON | Uploads an image from local system and returns JSON document describing image. |
dlex-layout | DlexLayout | String cloudDlexPath, LayoutDataResource resource | Uses a dlex file on cloud and local layout data (JSON dataset) and constructs a PDF. | |
pdf-info | PdfInfo | PdfResource | JSON | Upload a PDF from local system and return the PDF's metadata as JSON document. |
pdf-text | PdfText | PdfResource | JSON | Upload a PDF from local system and return the PDF's text as a JSON document. |
pdf-xmp | PdfXmp | PdfResource | XML | Upload a PDF from local system and return the PDF's XMP data as XML document. |
pdf | Pdf | --- | Returns a PDF. Refer to the Users Guide page on Instructions. |
Only the dlex-layout
endpoint takes a resource from the cloud (the DLEX file). All other endpoints use resources from local system. Also be certain any embedded resources for the DLEX are also on the cloud. The pdf
endpoint is discussed in instructions Users Guide page (Instructions).
Client Library
Complete documentation for each of the endpoints using the available client libraries is available via one of the following Users Guide pages.
Endpoint | Users Guide Page |
---|---|
dlex-layout | dlex-layout |
image-info | image-info |
pdf-info | pdf-info |
pdf-text | pdf-text |
pdf-xmp | pdf-xmp |
Be certain to refer to the endpoint's documentation. Each has a complete example in all five language that illustrate using the respective client library with the endpoint.