Overview

DynamicDocs is a JSON to PDF API based on LaTeX which allows users to generate documents with Tex to PDF templates. Convert your data with into truly beautiful documents with precise typesetting and the power of LaTeX. The LaTeX API allows to include logical statements, multi-page tables and charts in the templates.

DynamicDocs API allows to write templates in LaTeX online and then call the API with JSON data payload, which consists of dynamic data for the document. Once the call has been made, the API will send a response with a URL location of a status JSON file. By reading the status JSON file, you can see whether the document has been created successfully and a temporary, secure URL link is created for the client to download the document. For more information regarding making the API call to compile a PDF visit the Compile Resource page.

LaTeX is well known for its precise typesetting, however you can also create templates with custom charts and include conditional logic into the documents with R code injection. This allows to create truly dynamic documents which only depend on the data payload.

Quick Links - Creating Charts and Putting Dynamic Data into the Template

Follow these link to the documentation on how to include bespoke charts and how to merge JSON to PDF into templates.

API Consumption Options

DynamicDocs API is available directly via ADVICEment.io. To try the API for free and no obligations, you can sign up for an account and you will be given the FREE plan which gives you ability to create a limited number of documents per month. For more information on other plans, visit our pricing page.

Under the Hood

Advicement utilises the Amazon Web Services infrastructure and processing capability.

Specifically, our technology stack include AWS Lambda and AWS Simple Storage Service (S3). Our AWS region is set to Western Europe (Ireland). We also make use of the 'signed URLs' to safely and securely deliver the documents to our client.

For more information regarding Amazon Web Services, please visit the AWS website.

Create Your Account

To start using DynamicDocs API, you will need to register an account with a valid email by going to our registration page.

Registration-Page-Screenshot

Once your registration is successful, we will email you to verify your account. After verification you will be able to generate your API key (adv-security-token) in your dashboard.

JSON to PDF Templates

JSON to PDF Templates are ready-made templates available across all plans (free and paid plans). Using JSON to PDF templates is the easiest way of getting started with DynamicDocs API as no LaTeX knowledge is required. The templates have been designed by our team and their content is controlled by the JSON payload. The downside is that you are unable to make any custom adjustments unless they are already incorporated in the JSON to PDF template library.

Quick Links - JSON to PDF Templates

See a full list of JSON to PDF templates currently available with DynamicDocs API.

For a quick integration and API request examples visit our JSON to PDF Collection on Postman.

Creating Your Own LaTeX Template

Once registered you can start using our templates or building your own. Don't worry we have some ready made templates with which you can start. Sign in to your account and then visit My LaTeX Templates page. There you can find 'New Template' button which will give you various options of starting a new template.

Registration-Page-Screenshot
Quick Links - Ready Made Templates for You

We have ready made templates available for you. Visit our LaTeX Template Examples page and see if any of them is suitable for your business case. If not, we will happily create one for you. Just drop us a message using the Support page.

Afterwards you will need to name the template and describe it. Once you have succesfully created your template, you can start making changes to it, finding it in the list and clicking on 'Edit Template' button.

Registration-Page-Screenshot

Editing Your LaTeX Template

In the editing template section, you will be able to perform these functions:

  1. Create additional tex files
  2. Upload media files (jpg and png)
  3. Edit template files
  4. Edit JSON data payload files
  5. Save all the files
  6. Compile templates
  7. Publish templates
  8. Use the navigation menu to leave the editting template section
Registration-Page-Screenshot

Compiling Your Template via the Website

By using a 'Compile' button, the website would send the JSON data payload to the API and use the template settings to create the PDF. See the full list of available settings on the Template Settings page. Note that the template files used are the current files you are working with and not the ones which have been published. In other words the compile button lets you test and work with the template files in real-time.

Publishing Your Template and Creating Your End Point

By using the 'Publish' button, you effectively make the latest files available for consumption. By publishing again, you replace the previously published files with the current ones. Meaning, when you call the API through the end point, the template files used to create the documents will be the ones you have published last.

When you publish your template for the first time, you can view the template token available in the settings of your template. The template token is used in the path of your API call. This parameter does not change when you publish your template again.

Calling DynamicDocs API

DynamicDocs API lets you generate PDFs using API resource called compile. The compile resource lets you generate the PDF document using your LaTeX template files.

Endpoint Structure - POST

https://api.advicement.io/v1/templates/{templateToken}/compile?...

The templateToken corresponds to the id of the JSON to PDF template you are using or its the template token founds in your template's settings. It is a required path parameter which identifies the correct template files to be used to compile your PDF document.

The body of the request needs to be the template's JSON payload. The request needs to be authenticated with your account's API key (Adv-Security-Token) as a header parameter.

Quick Links - Authentication Guide

See our authentication guide to see how to authenticate your API calls.