Skip to main content
POST
/
api
/
pdf
Generate PDF from HTML
curl --request POST \
  --url https://peedief.com/api/pdf \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '{
  "html": "<string>",
  "fileName": "document.pdf",
  "options": {
    "format": "A4",
    "landscape": false,
    "printBackground": true,
    "margin": {
      "top": "20mm",
      "bottom": "20mm",
      "left": "15mm",
      "right": "15mm"
    },
    "scale": 1
  }
}'
{
  "success": true,
  "downloadUrl": "<string>",
  "previewUrl": "<string>",
  "fileName": "<string>",
  "fileSize": 123
}

Authorizations

x-api-key
string
header
required

Body

application/json
html
string
required

HTML content to convert to PDF

fileName
string
default:document.pdf

Name for the generated PDF file

options
object

Response

PDF generated successfully

success
boolean

Whether the PDF generation was successful

downloadUrl
string

URL to download the generated PDF

previewUrl
string

Embeddable URL to preview the generated PDF in an iframe

fileName
string

Name of the generated PDF file

fileSize
integer

Size of the generated PDF in bytes

I