Sync mode

Sync mode is the easier way to get your PDF immediately within a single API call, and your PDF file is ready to be distributed.

Sync mode will be protected under our Rate Limiting policy.

Endpoint

POST https://renderpdf.io/api/pdfs/render-sync

Content-Type

JSON or FormData.

Body

Parameter
Description

htmlContent (string - required)

The content that you want to render

headerHtmlContent (string - default: null)

The header of the PDF file (visible for pages)

footerHtmlContent (string - default: null)

The footer of the PDF file (visible for pages)

landscape (boolean - default: false)

Render in landscape or portrait

paperWidth (string|number - default: 8.5in)

Specify paper width using units like 72pt, 96px, 1in, 25.4mm, 2.54cm, or 6pc. Default unit is inches if unspecified.

paperHeight (string|number - default: 11in)

Specify paper height using units like 72pt, 96px, 1in, 25.4mm, 2.54cm, or 6pc. Default unit is inches if unspecified.

marginTop (string|number - default: 0.39in)

Specify top margin width using units like 72pt, 96px, 1in, 25.4mm, 2.54cm, or 6pc. Default unit is inches if unspecified.

marginLeft (string|number - default: 0.39in)

Specify left margin width using units like 72pt, 96px, 1in, 25.4mm, 2.54cm, or 6pc. Default unit is inches if unspecified.

marginRight (string|number - default: 0.39in)

Specify right margin using units like 72pt, 96px, 1in, 25.4mm, 2.54cm, or 6pc. Default unit is inches if unspecified.

marginBottom (string|number - default: 0.39in)

Specify bottom margin using units like 72pt, 96px, 1in, 25.4mm, 2.54cm, or 6pc. Default unit is inches if unspecified.

printBackground (boolean - default: false)

Print the background graphics.

scale (string|number - default: 1.0)

The scale of the page rendering.

Learn more about htmlContent, headerHtmlContent, and footerHtmlContent here

Available Error Responses

  • 422 when you have any invalid request data. E.g.: missing htmlContent, wrong scale number, etc.

  • 400 with RENDER_PDF_FAILED outcome, if we are unable to render your content (due to anything)

  • 429 when you used all of your available requests in a 1-minute window.

Last updated