> ## Documentation Index
> Fetch the complete documentation index at: https://docs.automate.ax/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Automate.ax automations are TypeScript programs.
> Use Bun for installation and command examples.
> Use Automate.ax for the product name and automate.ax for the package, CLI, and domain.
> Treat documented public APIs as current; do not invent transitional or deprecated names.

# Render PDF

> Render a URL or HTML document and return a PDF.

`cloudflare.renderPdf` prints a rendered page to PDF through Cloudflare Browser Run.

```ts automations/render-cloudflare-pdf.automation.ts theme={null}
import { automation, onDashboardRun } from "automate.ax"
import { cloudflare } from "automate.ax/cloudflare"

export default automation("Render invoice PDF", () => {
  onDashboardRun({ title: "Render invoice PDF" })
  const pdf = cloudflare.renderPdf({
    accountId: "cloudflare-account-id",
    pdfOptions: { format: "letter", printBackground: true },
    url: "https://example.com/invoices/1",
  })
  // Pass pdf to the file-storage or email action that should publish it.
})
```

## Inputs

Provide `accountId` and exactly one of `url` or `html`. `pdfOptions` controls paper format or dimensions, scale, orientation, margins, page ranges, backgrounds, CSS page sizing, headers, footers, outline, tagging, and PDF timeout. Cloudflare defaults to letter paper, scale 1, a 30-second PDF timeout, and tagged output. `cacheTtl` defaults to 5 seconds, and the common Browser Run page controls are available.

## Output

Returns the PDF as an `application/pdf` `Blob`. The action consumes Browser Run duration and is not replay-safe.
