AddThisFeature

PDF Export

Turn a record or report into a clean file people can save and send.

involved Data & Content

What it adds

Server-rendered PDFs of the app's important records and reports, generated in the background and delivered when ready.

What your agent is told to do

6
  1. 1

    Build one document template per exportable record type, with a defined page size, margins, header, and footer.

  2. 2

    Pin the fonts into the project and embed them. A font that exists on your laptop and not on the server produces a different document, and you will not notice until a customer does.

  3. 3

    Paginate deliberately: repeat table headers on every page, keep headings with the content that follows, and define what happens when a single row is taller than a page.

  4. 4

    Fetch private images and logos through short-lived authorized access at render time. Do not make an asset public just so the renderer can reach it.

  5. 5

    Generate anything large asynchronously and key the job so a second identical request joins the existing job instead of starting another.

  6. 6

    Do NOT rebuild raw tabular data extraction here — column selection, filter application, and export permissions are owned by CSV Export; extend that rather than building a second exporter. Generic queue progress and download-when-ready UI is owned by Background Job Progress.

Edge cases it handles

7
  • A table that spills across pages must repeat its header row, and no row may be cut in half at the page break.
  • Missing glyphs must be caught in a test, not shipped as boxes in a customer invoice.
  • An image that fails to load must render a placeholder and finish the document — one dead URL must not fail the whole export.
  • Long unbroken strings (URLs, tokens, IDs) will overflow the page box unless you explicitly allow them to wrap.
  • The generated file must respect the requester's permissions at render time, not at request time — a job that runs ten minutes later must re-check access.
  • Right-to-left text, non-Latin scripts, and currency symbols need a font that actually contains them.
  • A finished PDF stored for download needs an expiry; permanent artefacts of private data accumulate forever.

Definition of done

8
  • Fonts are embedded and output is byte-consistent across local, staging, and production.
  • Multi-page tables repeat headers and never clip content at a page boundary.
  • Private images render without being made publicly accessible.
  • Two identical export requests produce one job, not two.
  • Permissions are re-checked when the job runs, not only when it is queued.
  • The entry defers tabular extraction to CSV Export and progress UI to Background Job Progress.
  • The feature matches the existing design system.
  • No existing functionality is broken.

Related features

How it works

  1. 1

    Copy the link

    Grab the Markdown instruction URL for this feature.

  2. 2

    Give it to your AI

    Paste it into Claude Code, Cursor, v0, Lovable — whatever you build with.

  3. 3

    It inspects, then implements

    Your agent reads your existing app first, then adds the feature to fit it.

Works with your stack

These instructions are written to adapt. They tell the agent to detect your framework, match your existing design system, and reuse what you already have — rather than assuming a particular stack.

Need it tighter than that? Customize the feature and tell it exactly what you're running.