docstudio/pdf

Browser-safe PDF client. API reference in the DocStudio developer reference.

The browser-safe surface for requesting PDFs. It imports only core, uses no Node built-ins and no Playwright, and performs network access only through the fetch function you inject.

import { createPdfClient, printHtml } from 'docstudio/pdf';

Browser printing

printHtml(html) prints an HTML document through the browser print dialog. It creates a hidden sandboxed frame, prints it and removes it when the dialog closes, so only the document is printed. It needs a browser and no server. See Built-in actions.

Wire contract

The client sends POST <endpoint> with a JSON body { rdt, options? } and expects application/pdf bytes. The service returns an optional x-docstudio-pages header with the page count. See PDF client for statuses and limits.

Reference

The sections below are generated from the exported source.