DOCIFY HOSTED API / NO API KEY

Free HTML to PDF API

Generate a PDF from an HTML template in your server-side script. Docify renders the supplied HTML and inline CSS and returns the finished file. No account, API key or local Chromium installation is required for API consumers.

Endpoint

POST https://docify.site/api/v1/pdf

Request Content-Type: application/json
Successful response: application/pdf, returned as a file attachment.

Try it with cURL

Run this from the folder containing your input file, where applicable. The examples use a POSIX shell. Windows PowerShell users can use curl.exe and adapt line continuation and JSON quoting.

curl -X POST "https://docify.site/api/v1/pdf" \
  -H "Content-Type: application/json" \
  --data '{"html":"<h1>Project report</h1><p>Created with Docify.</p>","format":"A4","landscape":false,"margin":15}' \
  --output report.pdf

JSON body fields

OptionAccepted values and behavior
htmlRequired HTML string, up to 200,000 characters. The total JSON request body must fit within 1 MB.
formatA4 (default) or Letter.
landscapeBoolean, false by default.
marginInteger from 0 to 40 millimeters. Default is 15.

Use it from a Node.js script

This example uses Node.js 20+ with built-in fetch. Save it as an .mjs file and run it with Node. Check the response status before saving the response as a file.

import { writeFile } from "node:fs/promises";

const response = await fetch("https://docify.site/api/v1/pdf", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    html: '<h1 style="color:#285441">Project report</h1>',
    format: "A4",
    landscape: false,
    margin: 15,
  }),
});
if (!response.ok) throw new Error(await response.text());
await writeFile("report.pdf", Buffer.from(await response.arrayBuffer()));

Input rules and limitations

  • Use inline CSS or a style element in the supplied HTML. Embed PNG, JPEG and WebP images as data URLs when needed.
  • Scripts, forms, navigation and network requests are disabled. External images, web fonts and stylesheets will not load. This endpoint accepts HTML, not a web page URL.
  • Fonts available on the rendering server determine the result. Check page breaks and layout with your actual template before using it for reports or certificates.
  • The generated PDF has a 25 MB output limit. Large or complex documents can also reach the renderer's processing deadline.

Errors, rate limits and data handling

The public service needs no API key and permits up to 30 requests per minute per IP. It can also return 503 when processing capacity is full. For 429, respect the Retry-After response header. Use a bounded retry delay for temporary capacity errors.

Failures return JSON with an error field. Check 400 for invalid options, 413 for an oversized request, and 415 or 422 for unsupported or invalid input. A 500 response indicates a processing failure. Repeated retries may not solve a bad template or renderer problem.

Submitted documents and images are processed for the response and are not retained as uploaded files. Use these examples in server-side scripts: browser calls from unrelated origins are restricted by the service's CORS policy.

Try the browser tool

Prefer a visual interface before writing a script?

Try the HTML to PDF and certificate builder →