
Renders a structured Document — or an incrementally accumulating Document.Page stream — into a PDF and serves it live over HTTP and WebSocket, optionally POSTing every rendered document to a destination of its own. Each block is drawn inside the box it occupies on its source page, so the rendered PDF keeps the page's layout.
A PDF parsed by input_pdf_file into a Document is re-served as a downloadable PDF a browser or client GETs on the egress endpoint.
A scanned document's page layout is detected, and the recognised blocks are served as a PDF whose text sits where the layout put it.
Document and Document.Page. The Document arm renders all pages at once; the Document.Page arm accumulates arriving pages and re-renders the served PDF after each page.transports is fixed at startup and accepts only the http and websocket modes, run together. GET / (and GET /document.pdf) return the current PDF as application/pdf; websocket clients receive the full PDF as a binary frame on every update.render selects what a page carries. "image" embeds the page raster alone. "text" draws the page's blocks alone on a blank sheet, each inside its own box. "replace" embeds the raster, repaints every text box with the background colour sampled around it and draws the block text back into that box, which changes the wording while rules, tables, logos and photographs stay in place. "both" draws the block text over the untouched raster, showing the page's own glyphs and the block text together.url POSTs each rendered document as application/pdf as well as serving it, so a destination that cannot poll the port — a recorder, say — receives every version of the document as it is published, the last of them the finished one. Posting is independent of transports: both happen. An empty url posts nothing. Sending runs on its own thread and never delays rendering; a destination that falls behind loses the oldest held documents rather than growing the queue, and a refused POST is logged without a retry. headers travels verbatim with each POST, which is where a destination's credentials go — a recording tap refuses a POST that arrives without the token it issued.jpeg_quality; a page with no raster is a blank sheet sized from its declared width and height. GET / answers 503 until the first page renders.max_pages bounds the served PDF; a Document.Page stream drops the oldest page past the bound and a whole Document is truncated to that many pages.Automated release