The DynamicDocs API is JSON to PDF API based on LaTeX, which provides a quick way to generate PDFs documents in bulk with the ability to include graphics and logic in the templates. In this article, we will explain the API's new feature - JSON to PDF Templates, which allows users to generate PDFs using ready-made templates.
JSON to PDF Templates are ready-made templates available across all plans (including the free plan). Using JSON to PDF Templates is the easiest way of getting started with the DynamicDocs API, as no LaTeX knowledge is required. Instead, the contents of these templates are controlled by the JSON payload in the API request. The user simply edits a pre-defined JSON payload corresponding to the type of template they wish to create. After that, the user calls the API with their JSON data payload and is able to download a newly created PDF document thereafter.
Furthermore, these PDF documents are entirely dynamic and customisable. Users can include their text, data, colours, snippets of LaTeX code (if necessary) and images encoded as Base64 in the JSON payload. This allows the creation of genuinely dynamic documents, which are generated within a few seconds. The downside to the JSON to PDF Templates is that users are restricted to the templates currently available. In the upcoming months, we will be working on expanding the current template library.
At the time of writing, there are currently seven templates available for use via the DynamicDocs API, with more to be added in future. These include five simple templates and two Tex to PDF templates.
The simple template range consists of basic templates for everyday business and individual use. These include Simple Invoice Template, Simple Statement Template, Simple Quote Template, Simple Credit Note Template, and Simple Terms of Service Template. Each template page provides an API end point and a sample of the JSON payload. For a full list of the available templates, visit our JSON to PDF Templates page.
The Tex to PDF template range consists of two general templates allowing users to upload their own tex file, with Base64 encoded images in the JSON payload. After that, the PDF is generated using one of the two compilers available through the PDFLaTeX Template or the LuaLaTex Template.
The DynamicDocs JSON to PDF Templates are currently available directly via ADVICEment.io. Users can sign up for an account and be automatically given a free plan. The FREE plan allows one to create a limited number of monthly API calls. For more information the different plans, visit the DynamicDocs pricing page.
The DynamicDocs API Postman - Public Workspace is a dedicated Postman workspace for users who are looking to integrate with DynamicDocs API. The public workspace eliminates any difficulty integrating with DynamicDocs API as it provides examples of requests to the API. Various folders contain the API requests for the corresponding templates. Simply select the folder corresponding to the template you would like to generate.
Before hitting 'Send' on the POST request, users must get the API Key and set it as a parameter dynamicDocsAPIKey in the Environments tab. Alternatively, you can authenticate your API requests with the API key as Adv-Security-Token in the header tab of the request. Visit DynamicDocs authenticatiion guide for more information.
Users can edit the template by changing the JSON Payload in the Body tab of the request. Once they are happy with the design of the document, they click 'Send' on the POST request. The POST will respond with the URL location of the status JSON of the initial request. Once the API generates the PDF, the status JSON will be updated, and users can download the document using the link in the status JSON.
Now let's go through the steps again, using Simple Invoice v1 template as an example. Here are the steps:
The above steps work with all the JSON to PDF Templates and follow the same logic. Click on the Postman button below to open the DynamicDocs API - JSON to PDF Templates workspace.
JSON to PDF Templates are ready-made templates which are available across all price plans on ADVICEment.io. They are easy to use and require no LaTeX knowledge since the JSON payload controls their content. The fastest way to get started is to fork and use the DynamicDocs API – Public Workspace via Postman.