Tornado - Create a PDF using cURL via API

This example shows how to generate a PDF from a DOCX template using cURL.  It calls the Docmosis REST API to merge the data with the template and stream the result back.

The sample code includes the instructions to get started. You will need a Free Trial to install and run Tornado.

The linux command:

curl -F data=@data.txt -F templateName=WelcomeTemplate.docx -F outputName=myWelcome.pdf -o myWelcome.pdf http://localhost:8080/api/render

will call the Tornado server running at localhost:8080 to render the template WelcomeTemplate.docx to create file myWelcome.pdf. 


The data.txt file contains the data and in JSON format would look like this:
 
{
 "date":"29/Jan/2015",
 "message":"This Tornado Document Engine is working great!"
}

Feedback

Invalid Input

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam. Please also consider contacting support@docmosis.com if you need help with this article.

Sorry, this field will only accept letters and numbers, and not special characters, to limit spam.

Invalid Input

API Overview

Docmosis offers a high-performance, template-based PDF generation API. Suitable for use with custom software applications built using Java, C#/.Net, Python, Ruby and more. See a side-by-side comparison of the API for our SaaS and self-hosted products.