PDF KVADRATI / API

From request to document.

Two endpoints. JSON in. PDF out. Everything for your first integration.

Authentication

Create an account and open your workspace. Send the API key in the Authorization header. Keep it on your server, never in public browser code.

Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Base URL: https://pdf.kvadrati.com

Turnstile protects website forms. The conversion API uses your API key and does not need a Turnstile token.
POST /pdf/from-html

HTML → PDF

Send HTML and an optional filename. The result is a binary A4 PDF with backgrounds included.

FieldDescription
htmlRequired string. HTML document with CSS.
fileNameOptional string. The .pdf extension is added automatically.
{
  "html": "<html><body><h1>Hello PDF</h1></body></html>",
  "fileName": "report.pdf"
}

200 OK · Content-Type: application/pdf

POST /pdf/from-url

URL → PDF

Send a publicly accessible URL. The service fetches its HTML and resolves relative resource links. Pages requiring sign-in or an interactive session are not suitable.

{
  "url": "https://example.com/report",
  "fileName": "report.pdf"
}

The URL must use HTTP or HTTPS. Only use content you are authorised to access and convert.

Integration examples

cURL

curl https://pdf.kvadrati.com/pdf/from-html \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html":"<h1>Hello PDF</h1>","fileName":"report.pdf"}' \
  --output report.pdf

Python

import os
import requests

response = requests.post(
    "https://pdf.kvadrati.com/pdf/from-html",
    headers={"Authorization": "Bearer " + os.environ["PDF_API_KEY"]},
    json={"html": "<h1>Hello PDF</h1>", "fileName": "report.pdf"},
    timeout=60,
)
response.raise_for_status()
with open("report.pdf", "wb") as file:
    file.write(response.content)

C# / .NET 10

using System.Net.Http.Headers;
using System.Net.Http.Json;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(
    "Bearer", Environment.GetEnvironmentVariable("PDF_API_KEY"));
using var response = await client.PostAsJsonAsync(
    "https://pdf.kvadrati.com/pdf/from-html",
    new { html = "<h1>Hello PDF</h1>", fileName = "report.pdf" });
response.EnsureSuccessStatusCode();
await File.WriteAllBytesAsync("report.pdf", await response.Content.ReadAsByteArrayAsync());

Limits and errors

A free account has 2 conversions per day. The daily period uses UTC; a failed conversion can consume an attempt. Enquire for higher volumes.

HTTPMeaning
400Invalid or missing API key, empty input or daily quota reached.
429Too many requests. Wait before retrying.
500Content retrieval or PDF generation failed.

Check HTTP status before saving a response. Error responses are not PDF files.

GET /pdf/ping

A simple service availability check, without an API key.

Necessary cookies support sign-in, security and language preferences. Optional analytics is off by default. This site currently loads no analytics tools.

Read our privacy notice