render_pdf
Print HTML to PDF
Lays out a whole HTML document (with its CSS) as paged print and returns a download link to the PDF, valid 24 hours, and the document's edit link in the ReflowPDF editor (give the person both). Use @page for paper and margins, margin boxes for headers, footers and page numbers; JavaScript does not run. Read read_guide topic "html" before the first document. To change the document later, use update_document with its document_id.
Parametershtmlrequiredpreviewfilename
render_template
Fill a template and print it
Fills a template with JSON data and prints it to PDF (a download link, valid 24 hours, and the edit link in the editor, where its template and data stay editable — until the person edits it on the page, which makes it a plain HTML document: then change its html). Either a gallery template (template_id from list_templates; without data it prints its sample) or your own template source. Send data in the shape of the template's sample (get_template). The language: read_guide topic "templates".
Parametersdatapreviewfilenametemplatetemplate_id
list_templates
Find a document template
Lists the gallery's ready documents — invoices, quotes, receipts, statements, reports, contracts, letters, CVs, certificates, tickets, labels, menus and more — each a template with sample data. Search by a word ("invoice", "contract") or a category.
Parametersquerycategory
get_template
Read a template and its sample data
Returns a gallery template's source and its sample data, to fill with the person's values (render_template) or to adapt into your own template.
Parametersidrequired
open_in_editor
Open in the ReflowPDF editor
Returns the edit link of a document in the ReflowPDF editor, where the person edits it on the page and downloads it: your HTML, or a template with its data (kept as template and data, both editable). Use when the person wants to change the document themselves; you can read their changes and change it too (get_document, update_document).
Parametersdatahtmlnametemplate_id
get_document
Read a document by its link
Returns a document made with ReflowPDF (by you, or opened in the editor from your link) as it is now — the person may have edited it in the editor: its source HTML, template data and revision. Read it before changing it with update_document.
Parametersdocument_idrequired
update_document
Change a document by its link
Writes a new version of a document by its link — e.g. the person asks in the chat to remove something on page 2 — and prints it again: the PDF link, the same edit link (the editor open on it shows the change). Send the whole new html (and data, if it is a template), changed from what get_document returned, with base_revision: a document the person changed after you read it is refused, so read it again.
Parametersdatahtmlnamepreviewfilenamedocument_idrequiredbase_revisionrequired
upload_image
Keep an image for a document
Keeps an image whose bytes you have (one you made, or a small file you can read) and returns its link, to use as <img src> or CSS url() in render_pdf, render_template, open_in_editor and update_document — instead of a data: URI, so the document stays small when you read it back. You send the bytes as base64 text, so this is for small images (a logo, an icon: tens of KB); PNG, JPEG, GIF, WebP or AVIF, at most 10 MB. A picture the person has (their photo, their logo file): ask them to add it in the editor at the edit link — drag it onto the page — and read it back with get_document. An image at a public https address needs no upload: use that address. An SVG goes into the HTML as it is. The image lasts 30 days after a document using it last changed.
Parametersimage_base64required
import_pdf
Import a PDF into the editor
Returns a link (valid 24 hours) that opens an existing PDF in the ReflowPDF editor's import, which rebuilds it as an editable document. A PDF made by ReflowPDF opens from its own source at once; any other is rebuilt by AI, which needs a free account and uses its AI pages (the editor shows the cost first). Give a public https URL of the PDF, or its bytes in base64 (small files).
Parametersurlnamepdf_base64
connect_account
Connect the person's ReflowPDF account
Signs the person in to their ReflowPDF account (a free one is enough), when they want PDFs without the ReflowPDF mark, their plan's pages, or the documents you make kept in their account. Their client shows a Connect button; once they have signed in, every call of yours is their account's. Without it everything works too, as a guest: every page, with a small mark.
Takes no parameters.
read_guide
How to write documents for ReflowPDF
The engine's guide: "overview" (the tools), "html" (paper, headers/footers, page numbers, tables of contents, footnotes, fonts, images, accessibility), "pages" (page kinds, breaks and keeping together, covers, numbering, bleed and crop marks), "design" (columns, drop caps, page decorations and watermarks, spacing, images and text wrap, typography), "charts" (the chart block), "codes" (QR codes and barcodes), "forms" (fillable fields), "templates" (the template language).
Parameterstopic