Dashboard · 4 min read

Stored PDFs

By default a generated PDF is streamed back to your request and never retained. When you want BladePDF to keep a copy — for re-download, audit, or asynchronous delivery — opt in per render with storePdf().

Opt in with storePdf()

Call storePdf() before render() to persist the generated PDF. Synchronous delivery still returns the PDF bytes in the RenderResult; asynchronous delivery requires storage and returns a RenderSubmission instead.

PHP
php
 1$result = BladePDF::fromTemplate('invoice.standard', $context)
 2    ->reference($invoice->uuid)
 3    ->storePdf()
 4    ->render();
 5
 6$result->pdf();          // Local PDF bytes
 7$result->storedPdfUrl(); // Signed stored PDF URL, or null

Over the REST API this is the store_pdf form field. Set a reference() so stored PDFs are easy to find and tie back to your records.

Browse and download

Stored PDFs appear on the Stored PDFs page in the dashboard. From there you can preview a file inline, download it, or open the raw bytes. Each entry keeps the render's reference and metadata so you can search for the exact document you need.

Storage quota

Stored PDFs count against your workspace's storage quota along with dashboard-managed assets. Storage is a running total, not a monthly reset — when you approach the quota, delete PDFs you no longer need to free space. If the workspace is at its storage limit, synchronous renders can still return PDF bytes without storing them, while asynchronous submissions are rejected before acceptance.

Storing is opt-in and per render

Without storePdf(), nothing about your document is retained — only render metadata and logs (see Renders & Logs). Store only what you actually need to keep so you stay within your storage quota.

Retention and automatic cleanup

By default a stored PDF is kept until you delete it. Two optional workspace settings on the Stored PDFs page automate cleanup:

  • Retention window — set a number of days (1–3650) and stored PDFs older than the window are deleted automatically.
  • Auto-cleanup on storage limit — when the workspace exceeds its storage quota, the oldest stored PDFs are removed first until usage fits again.

Independently of these settings, a stored PDF never outlives its render history entry: render records are kept for 13 months (400 days), and when a record expires its stored PDF is deleted with it (see Renders & Logs → Retention).

Not a backup or archive service

Stored PDFs are a convenience for re-download and delivery, with a hard upper bound of 13 months. Keep authoritative copies of documents you must retain long-term (invoices, contracts) in your own storage — for example by fetching the PDF from the webhook event and saving it on your side.

When to store

  • Re-download — let users fetch the same invoice or report again without re-rendering.
  • Audit trail — keep the exact document that was produced at a point in time.
  • Asynchronous delivery — render now, deliver later, or hand a link to another system.

If you only need the file once, skip storing and use a synchronous render result helper such as download(), save(), or base64Pdf() to keep the PDF in your own storage instead. See Async Renders when the request should return before generation finishes.

Was this page helpful?
Let us know if something's missing or unclear.