SnapPDFSnapPDF
← back to showcase
EXAMPLE BUILD — illustrative architecture, not a published case study

LedgerFlow

Stripe invoice automation that actually looks like their brand.

SaaS billing platform · Seed stage · 8 engineers

The build

Every Stripe `invoice.paid` event triggers a SnapPDF pipeline: merge with branded cover, stamp PAID, compress to <500KB, email via Resend. 900ms median, $45k/yr saved.

Stack

  • · Node.js
  • · Stripe
  • · Postgres
  • · Resend
  • · SnapPDF

Architecture

your app/mergeSnapPDF/watermarkSnapPDF/compressSnapPDFdelivery

Ops used: /merge → /watermark → /compress

How they use SnapPDF

LedgerFlow sells a metered billing tool. Its own invoicing flow had to be bulletproof — customers of a billing tool notice when their vendor sends a $12MB PDF attachment that bounces off corporate mail gateways.

The pre-SnapPDF stack used three separate vendors: DocRaptor for HTML→PDF, a custom watermark service, and Adobe's compression API. The glue: a 350-line Node.js worker with bespoke retry logic and an S3 intermediate layer. Cost: $1,500/month in vendor fees + 0.2 FTE maintaining the worker.

Migrating to SnapPDF took 4 days of engineering. The new worker is 38 lines. On invoice.paid, it: merges Stripe's invoice PDF with a branded cover + T&Cs, stamps PAID diagonally at 18% opacity, compresses to ~450KB average. Total round-trip: 880ms median. The email goes out through Resend immediately after.

The compression step was the quiet win. LedgerFlow's previous attach-rate for invoices was 98.2% — 1.8% bounced off Gmail's 25MB limit because the invoice PDFs ballooned when customers had large T&Cs. After SnapPDF, bounce rate is 0.03% (essentially zero). Billing-related support tickets dropped 63%.

Total saving: $45k/year direct cost + one afternoon of engineering per quarter. The part LedgerFlow's CEO cares about: she hasn't personally answered a "where's my invoice?" email in three months.

Outcomes

Vendor count
3 → 1
Median latency
2.4s → 880ms
Bounce rate
1.8% → 0.03%
Annual saving
$45,000

Integration pattern

A simplified excerpt showing the core SnapPDF calls.

// apps/billing-worker/src/stripe-webhook.ts
import Stripe from 'stripe';
import { SnapPDF } from '@snappdf/sdk';
import { Resend } from 'resend';

const stripe = new Stripe(process.env.STRIPE_SECRET_KEY!);
const snap = new SnapPDF({ apiKey: process.env.SNAPPDF_KEY! });
const resend = new Resend(process.env.RESEND_API_KEY);

export async function handleInvoicePaid(event: Stripe.Event) {
  const invoice = event.data.object as Stripe.Invoice;
  if (!invoice.invoice_pdf || !invoice.customer_email) return;

  const { pdf } = await snap.pdf.merge({
    files: [COVER_PDF_URL, invoice.invoice_pdf, TERMS_PDF_URL],
  });
  const { pdf: stamped } = await snap.pdf.watermark({
    file: pdf, kind: 'text', text: 'PAID',
    position: 'diagonal', opacity: 0.18, color: '#0f766e',
  });
  const { pdf: small } = await snap.pdf.compress({
    file: stamped, level: 'high', stripMetadata: true,
  });

  await resend.emails.send({
    from: 'billing@ledgerflow.example',
    to: invoice.customer_email,
    subject: `Invoice ${invoice.number} — Paid`,
    attachments: [{ filename: `${invoice.number}.pdf`, content: Buffer.from(small) }],
  });
}

Start building like this

Free tier gives you 100 ops/month — enough to prototype any of the flows on this page. No card required.

Other builds