ReflowPDF
v1.0.1Paged PDFs from HTML and CSS or templates, with an editor link to keep editing every document.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
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. Use @page for paper and margins, margin boxes for headers, footers and page numbers; scripts do not run unless options.javascript is set; read_guide topic "html" describes what the engine prints. update_document changes the document later by its document_id. The PDF carries the document's editable source (encrypted; keep_editable false leaves it out): import_pdf, or Import in the editor, restores it as this document, without…
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. The data takes the shape of the template's sample (get_template); read_guide topic "templates" describes the language. The PDF carries the document's editable source (encrypted; keep_editable false leaves it ou…
check_document Check a document while you work on it
Prints a document only to check it — the person sees nothing: no PDF link, no card, nothing counted to their plan's pages. Answers with its pages as pictures, which heading starts on which page (outline), what runs past the paper, fonts not found, the tag tree a screen reader gets, the standards the file declares and, where the account's plan includes it, veraPDF's report on the standard it declares (PDF/UA-1, PDF/UA-2 or PDF/A-3a): each rule that fails, with its pages. For trying a layout, finding where a part lands and fixing what the validator finds; the person gets the document from rend…
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.
| Parameter | Type | Description |
|---|---|---|
category | string | Only this category. |
query | string | Words to look for in the name, purpose or category. |
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.
| Parameter | Type | Description |
|---|---|---|
id * | string | The template's id, from list_templates. |
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).
| Parameter | Type | Description |
|---|---|---|
data | object | The values of the template, if it is one. |
html | string | The HTML document (or your own template source, with data). |
name | string | The document's name in the editor. |
template_id | string | A gallery template's id, instead of html. |
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, which update_document takes as base_revision.
| Parameter | Type | Description |
|---|---|---|
document_id * | string | The document_id (or the edit link) from render_pdf, render_template or open_in_editor. |
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). The new version replaces the one before. A change of a few places: edits — each replaces one exact piece of the source as get_document returned it (cheaper than sending the whole document, and nothing else moves); a rewrite: the whole new html. With base_revision: a document the person changed after you read it is refused, so read it again. The PDF carries the document's editable s…
upload_image Keep an image for a document
Keeps an image and returns its link, to use as <img src> or CSS url() in render_pdf, render_template, open_in_editor and update_document — so the document stays small when you read it back. Give one of: image — a picture the person attached in the chat, as your client passes attached files to tools; image_base64 — bytes you have yourself (one you made, a small file you can read: base64 is text you write, so tens of KB). PNG, JPEG, HEIC, GIF, WebP or AVIF; a photo over 10 MB or in HEIC is brought to print size (4096 px on the long side). A picture the person attached that you can see but…
| Parameter | Type | Description |
|---|---|---|
image | object | A picture the person attached in the chat. |
image_base64 | string | The image's bytes, base64 (a data: URI is taken too). |
ask_for_images Ask the person for their images
For a picture the person has on their phone or computer and has not attached in the chat: gives a link where they upload it — their logo, photos, a signature scan; also when you see an attached picture but have no file of it. The person opens the link and picks the files; ask_for_images with the upload_id then returns each image's link (with its size and file name), for the document in render_pdf or update_document. The link also accepts the file’s bytes by POST. The link works for 24 hours and takes up to 50 images — photos straight from a phone or a camera too (HEIC, up to 40 MB each;…
| Parameter | Type | Description |
|---|---|---|
note | string | What to upload, shown to the person on the page, e.g. "Your company logo (PNG with a transparent background is best)". Only for a new link. |
upload_id | string | The upload_id of a link you gave: what the person has uploaded to it so far. |
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 these tools printed, or one exported from the ReflowPDF editor with «Keep the PDF editable», is restored from its own source with one click (Restore), without AI; any other is rebuilt by AI, which needs a signed-in ReflowPDF account and uses its AI pages (the editor shows how many first). A document made with these tools needs no import: its edit link opens it. Give the PDF the person attached in the chat (pdf, as your client passes attached files), a…
| Parameter | Type | Description |
|---|---|---|
name | string | The document's name. Default: the file's. |
pdf | object | A PDF the person attached in the chat, as your client passes attached files to tools. |
pdf_base64 | string | The PDF's bytes, base64 (up to 20 MB). |
url | string | A public https address of the PDF. |
connect_account Connect the person's ReflowPDF account
Signs the person in to their ReflowPDF account (any ReflowPDF account), 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.
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).
| Parameter | Type | Description |
|---|---|---|
topic | string | Default: html. |