API Documentation
Pdfly API provides secure access to generate PDF documents from HTML content, making it easy to generate and customize pdf for various applications. This documentation guides you on how to interact with the API and generate high-quality PDFs on the fly with your own applications.
To get started, signup and create a new API key in your developer settings, then read about how to make requests to generate PDFs using our HTTP APIs. Go a step further by integrating our API into your applications.
All Parameters
This section lists all the parameters that can be used with the Pdfly API.
PARAMETER | DESCRIPTION | DEFAULT |
---|---|---|
body | The html document to be converted to pdf | |
url | The url of the html document to be converted to pdf | |
page_heading | The html header that would be displayed at the top of every page of the generated pdf. | |
page_footer | The html footer that would be displayed at the bottom of every page of the generated pdf. | |
layout | This is an object containing layout data for the document, a full detail of the layout object is provided in a separate table below. |
Layout
PARAMETER | DESCRIPTION | DEFAULT |
---|---|---|
format | Options for the pdf format include A0, A1, A2, A3, A4, A5, A6, Legal, Letter, Tabloid, Ledger, Executive. It should be used if height and width are not specified. | A0 |
orientation | Sets the orientation of the pdf created to portrait or landscape. | portrait |
width | Sets custom dimensions for width of the created pdf. These dimensions can be specified in pixels, inches, centimeters, or millimeters. It can be used instead of format. | |
height | Sets custom dimensions for height of the created pdf. These dimensions can be specified in pixels, inches, centimeters, or millimeters. It can be used instead of format. | |
margin_top | Sets the top margin of the pdf. It can be specified in pixels, inches, centimeters, or millimeters | |
margin_bottom | Sets the bottom margin of the pdf. It can be specified in pixels, inches, centimeters, or millimeters | |
margin_left | Sets the left margin of the pdf. It can be specified in pixels, inches, centimeters, or millimeters | |
margin_right | Sets the right margin of the pdf. It can be specified in pixels, inches, centimeters, or millimeters |