Skip to main content

Using the DynamicPDF API Make App


Learn how to use the DynamicPDF API custom Make app by building a scenario that combines the dlex-layout (DlexPath) and pdf-image modules to generate PDF reports and rasterize them directly within Make.

In this tutorial, you’ll build a Make scenario that batch-generates DLEX reports from files in a Google Drive folder, saves each resulting PDF, and then rasterizes those PDFs into TIFF images. Both the PDF reports and their corresponding TIFF outputs are written back to Google Drive. This walkthrough demonstrates a practical, real-world workflow that shows how easily the DynamicPDF API can automate document generation and downstream processing.

tip

Be certain to check-out our other real-world solutions using the DynamicPDF API after completing this tutorial.

  • Batch PDF Rasterization pdf-image (solution) - convert Word, Excel, HTML, images, and PDFs to PDFs
  • Report Creation dlex-layout (solution) - create a PDF report
  • Batch Conversion pdf endpoint (solution) - convert PDF to images
  1. Add a Google Drive Watch - Files in a Folder module and configure it to monitor newly created files by selecting By Created Time for Watch Files (Google Drive - Watch Files in a Folder).

  1. Add a Google Drive - Download a File module and map its File ID parameter to the File ID from the Google Drive - Watch Files in a Folder module (Google Drive - Download a File).


You now have two modules in the scenario: Google Drive - Watch Files in a Folder and Google Drive - Download a File.


tip

How you obtain a resource is not important for understanding the sample scenarios that follow. The file could come from Google Drive, Dropbox, a public URL, an Amazon S3 bucket, or any other source supported by Make. What matters is that the module producing the file provides the required metadata, including the file name, MIME type, and binary content, so it can be sent correctly to the DynamicPDF API endpoints.

  1. Add a DynamicPDF API - dlex-layout (DlexPath) module and add the dlex path from DynamicPdf API storage to the DLEX Path and then select Map for the File.
  1. Map the Google Drive - Download a File module's Name to LayoutData File Name and Data to Layout Data File (Data).

  1. Add a Tools - Set variable module and assign outputPdfFile as the Variable name, and parse the Name from Google Drive - Download a File to replace json with pdf (Tools - Set variable).
{{replace(lower(1.name); "json"; "pdf")}}

  1. Add a Google Drive - Upload a File module to the scenario (Google Drive - Upload a File).
  1. Map the outputPdfFile variable to the File Name and Generated PDF to Data.

The scenario now contains five modules that work together to generate a PDF report for each DLEX file in the source Google Drive folder and save the finished reports to a separate Google Drive folder.

Add a Router so the scenario can also route the generated PDF reports to the DynamicPDF API pdf-image module for rasterization, and then pass the resulting images to a Google Drive - Upload a File module to save the rasterized outputs to Google Drive (Router).

  1. Click the small wrench between the Tools and Google Drive modules and add a Router module.

When the Router is added, it automatically connects the Google Drive - Upload a File module as the first route.

  1. Add a DynamicPDF API - pdf-info module as the second route.

  1. Map outputPdfFile to PDF File Name and Generated PDF to PDF File Data. Select TIFF as the Image Format (if).

  1. Add a JSON - Parse JSON module and map PDF Image Result to the JSON string.

  1. Select Add to open a dialog. Enter pdf-image-structure as the Data structure name and then select Generate to open another dialog.

  1. Select JSON as the Content type and add a sample data structure of JSON returned from a call to the pdf-image endpoint to Sample data.
{
"images":
[
{
"pageNumber":"--numeric-text--",
"width":--numeric--,
"height":--numeric--,
"billedPage": --numeric--,
"data" : "--base64encoded-data--"
}
],
"contentType": image/--imagetype--
"horizontalDpi": --numeric--,
"verticalDpi": --numeric--
}
info

See pdf-image API documentation for more information on the pdf-image endpoint.

  1. Select Generate to generate the data structure.
  2. Add an Iterator module and assign Images[] from the JSON - Parse JSON module (Iterator).

  1. Add a Tools - Set multiple variables module and create a variable named binaryData and a variable named fileName (Tools - Set multiple variables).
  2. Map the data from the Iterator and convert the data from base64 to binary.
{{toBinary(9.data; "base64")}}
  1. Map the outputPdfFile from Tools - Set variable and pageNumber from the Iterator and construct the file name for each image.
{{3.outputPdfFile}}-{{9.pageNumber}}.tif

  1. Add a new Google Drive - Upload a File module to the scenario. Map the fileName from Tools - Set multiple variables to File Name and binaryData to Data.

  1. Run the scenario and it creates two PDF reports and six images