AddThisFeature

PDF Viewer

Let people read a PDF inside the app instead of downloading it first.

moderate Documents & Files

What it adds

An in-app PDF reader with page navigation, zoom, rotation, and text search over the document.

What your agent is told to do

5
  1. 1

    Render pages inside the app's existing layout with page navigation, zoom, rotation, and a search over the document text. A download button stays available at all times.

  2. 2

    Serve the file through the app's existing Secure File Downloads path so viewing is authorised exactly like downloading, and a viewer URL cannot be shared to bypass permissions.

  3. 3

    Reserve each page's dimensions before it renders so the scroll position stays stable and the document does not jump while the reader scrolls.

  4. 4

    Render only the pages near the viewport and discard those far outside it, so a long document does not grow memory until the tab dies.

  5. 5

    Do not build this next to the app's PDF Export as a separate document stack. Viewing and exporting should agree on where files live, how they are named, and who may read them.

Edge cases it handles

8
  • A four-hundred-page file must never render all at once. Render lazily around the viewport and keep the page count and jump-to-page control working before every page has been drawn.
  • Password-protected files need a prompt, and corrupt or truncated files need a plain message with a download link. Neither may present as an endless spinner.
  • Text must stay selectable and searchable. Rendering every page to a flat image loses copy, search, and screen reader access, which is most of why people wanted the viewer.
  • Zoom level, current page, and rotation should be remembered per document, so returning to a long file does not mean scrolling back to where the reader was.
  • Low-memory and unsupported devices must fall back to a download or the browser's own viewer rather than crashing the tab.
  • PDFs can carry embedded scripts, forms, and remote resources. Render with scripting disabled and do not let the document fetch anything from a third-party host.
  • Keyboard users need page navigation, zoom, and search without a mouse, and the page container needs a focusable, scrollable region.
  • Printing from inside the viewer should hand off to the real file rather than printing rasterised canvases at screen resolution.

Definition of done

9
  • A PDF opens and is readable in the app without downloading it.
  • Long documents render lazily and remain responsive with hundreds of pages.
  • Text is selectable and the in-document search finds it.
  • Password-protected and corrupt files produce a clear message rather than a hang.
  • Zoom, page, and rotation are restored when the reader returns to a document.
  • Unsupported or low-memory devices degrade to a download link.
  • Access is authorised on every request through the app's existing secure file path.
  • 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.