Skip to content

Repository files navigation

SnaPDF Web

Website for SnaPDF — save any JavaScript-rendered page as a PDF or plain text file. Paste a ChatGPT or Claude share link, pick your settings, and download in seconds.

Built with Nuxt 4, deployed on Vercel.

Features

  • Converts any JS-rendered page (ChatGPT, Claude, etc.) to PDF or plain text
  • Handles virtual scroll and lazy-loaded content — every message captured
  • PDF options: page size (Letter/A4), margin, landscape orientation
  • Selectively hide user prompts or assistant responses
  • CSS selector override for custom content targeting
  • In-session history with inline preview and re-download
  • Light/dark/system color mode
  • Auto-detects Letter vs A4 based on browser locale

API

GET /api/convert — streams progress over SSE, then delivers the file as a base64 payload.

ParameterTypeDefaultDescription
urlstringPage URL to convert (required)
formatpdf | txtpdfOutput format
pageSizeletter | a4letterPDF page size
marginnumber36PDF margin in points
landscapebooleanfalseLandscape orientation
hideUserInputbooleanfalseOmit user messages
hideAssistantOutputbooleanfalseOmit assistant messages
selectorstringCSS selector for content nodes

SSE event types: progress · complete · error

Development

npm install
npm run dev # nuxt dev

To test with Vercel Functions locally:

npm run build
vercel dev

Scripts

CommandDescription
npm run devStart dev server
npm run buildProduction build
npm run lintLint with ESLint
npm run fixAuto-fix lint issues
npm testRun tests (Vitest)
npm run typecheckType-check with vue-tsc
npm run release:patchBump patch version and push tags

Deployment

Deploys automatically to Vercel on push to main. Functions are configured with a 300s max duration to accommodate long-running Puppeteer jobs.

On Vercel, @sparticuz/chromium provides a serverless-compatible Chromium binary. Set PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true in your Vercel environment variables.

CLI

SnaPDF is also available as a standalone CLI tool:

npm install -g snapdf
snapdf <url> [options]

See npmjs.com/package/snapdf for full CLI docs.

About

Web app for SnaPDF. Convert ChatGPT, Claude, and other JavaScript-rendered pages into PDF or plain text files with customizable export options.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages