Private betav0.1.0
Docs
Format developer documentation

Preview as PDF

Generate a PDF preview of your document at any time during development.

Studio lets you generate a real PDF preview of your document at any point during development. The PDF is generated using the Format API, so it reflects exactly what you will get in production.

Generate a PDF

Use the generate button in the Studio sidebar to trigger a PDF preview for the current document and variant.

image placeholder

Studio sidebar showing the generate PDF button

Replace this with the final image asset.

The PDF downloads to your machine as [document-name]-[variant].pdf.

Setup

PDF generation requires a Format API key.

Create an API key

Go to the API keys section of your dashboard and create a new key.

Add it to your environment

Add the key to your .env file in the root of your project.

.env
FORMAT_API_KEY=your_api_key_here

No server restart is needed. Studio picks up the key immediately.

Usage

Careful

PDF generation in Studio uses your Format API quota. PDFs generated during development count toward your organization's usage the same as production renders.

Performance

PDF generation in Studio is slower than at runtime. Studio compiles your document on every request, which adds overhead that is not present in production. You should expect your production generation times to be faster. Full timing and tracing metrics for any PDF generation are available in Metrics.

Was this page helpful?