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.

Guides

Authentication

Learn how to authenticate your API requests.

Read more

Delivery Mode

Understand how responses to requests are sent to users.

Read more

Errors

Read about the different types of errors returned by the API.

Read more

Resources

Learn how to programmatically configure webhooks for your app.

Read more

All Parameters

This section lists all the parameters that can be used with the Pdfly API.

PARAMETERDESCRIPTIONDEFAULT
bodyThe html document to be converted to pdf
urlThe url of the html document to be converted to pdf
page_headingThe html header that would be displayed at the top of every page of the generated pdf.
page_footerThe html footer that would be displayed at the bottom of every page of the generated pdf.
layoutThis is an object containing layout data for the document, a full detail of the layout object is provided in a separate table below.

Layout

PARAMETERDESCRIPTIONDEFAULT
formatOptions 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
orientationSets the orientation of the pdf created to portrait or landscape.portrait
widthSets 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.
heightSets 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_topSets the top margin of the pdf. It can be specified in pixels, inches, centimeters, or millimeters
margin_bottomSets the bottom margin of the pdf. It can be specified in pixels, inches, centimeters, or millimeters
margin_leftSets the left margin of the pdf. It can be specified in pixels, inches, centimeters, or millimeters
margin_rightSets the right margin of the pdf. It can be specified in pixels, inches, centimeters, or millimeters

Was this page helpful?