RenderPDF.io
RenderPDF.ioGet Free API Key
  • RenderPDF.io
  • 🔋API Authentication
  • ⚡Rate Limiting
  • 📬Webhooks
  • ➕Usage Calculation
  • 📃Render PDFs
    • 🚀RenderPDF APIs
      • Sync mode
      • Async mode
    • 🖼️Template & Styling
    • 📔Best practices
  • 🛠️Libraries
    • PHP
    • Laravel
    • Node.JS / JavaScript
    • Python
Powered by GitBook
On this page
  • Endpoint
  • Content-Type
  • Body
  • Available Error Responses
  1. Render PDFs
  2. RenderPDF APIs

Sync mode

PreviousRenderPDF APIsNextAsync mode

Last updated 1 year ago

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 .

If you're looking for performance, fast, and don't need to implement your own Rate Limiting layer, check out the .

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.

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.

Learn more about htmlContent, headerHtmlContent, and footerHtmlContent

📃
🚀
Rate Limiting policy
Async Mode
here