Edit PDF Text on the Server — No Overlays, No Flattening
The only Node.js PDF library that actually edits text inside PDFs. Replace paragraphs, redact patterns, preserve fonts. Works with Express, Next.js, serverless, and Docker. Async/await API.
The Problem
Why Existing Node.js PDF Editing Falls Short
pdf-lib can add content but can't edit existing text. Apryse (PDFTron) has full editing but costs tens of thousands per year. Adobe PDF Services requires sending your documents to Adobe's cloud and rebuilds the entire PDF on every change. None of them offer simple find-and-replace with automatic reflow.
The Limitations
- pdf-lib — can add content but cannot edit existing text in place
- Apryse — full editing, but enterprise pricing ($10K+/year)
- Adobe PDF Services — cloud-only, extracts and rebuilds the entire document
- Overlay-based approaches break text selection and PDF search
- No simple regex-based find-and-replace across documents
What PDFDancer Changes
- Edit text directly inside PDFs — no overlays, no regeneration
- Replace words, paragraphs, or patterns with automatic reflow
- Fonts and formatting are preserved automatically
- Regex-based selection and batch redaction
- Works with Express, serverless (Lambda), Docker, and cloud functions
See It in Action
Edit PDFs Like Text Files
Three examples: text editing with reflow, PII redaction with regex, and an Express.js middleware for handling uploads. All use async/await.
Comparison
PDFDancer vs. pdf-lib, Apryse, Adobe
| Feature | PDFDancer | pdf-lib | Apryse (PDFTron) | Adobe PDF Services |
|---|---|---|---|---|
| Read Text | ✓ Full | ✓ Limited | ✓ Full | ✓ Full |
| Edit Text | ✓ Full with reflow | ✗ Add-only (no in-place edit) | ✓ Full | ✓ Extract → rebuild |
| Font Preservation | ✓ Automatic | ✗ Manual embedding | ✓ Automatic | Partial — re-embedded on export |
| Redaction (True) | ✓ Yes + audit trail | ✗ Overlays only | ✓ Yes | ✓ Separate sanitize API |
| Layout Preservation | ✓ Automatic reflow | ✗ Manual coordinates | ✓ Full | Partial — document rebuild |
| Self-Hosted | ✓ Yes | ✓ Yes (open source) | ✓ Yes (on-prem license) | ✗ Cloud-only |
| Pricing | Free tier + usage-based | Open source (free) | $$$$ enterprise licensing | $$$ per API call |
Deploy Anywhere
Next.js, Lambda, Docker — Ready to Go
Same npm package, different environments. Here are production-ready patterns for the most common deployment targets.
Next.js API Route, AWS Lambda, Docker Compose
Next.js App Router API route with file upload. AWS Lambda triggered by S3 upload. Docker Compose for self-hosted deployment.
Getting Started
From npm to First Edit in 5 Minutes
Install via npm
npm install pdfdancer-client-typescript
Get Your API Key
Sign up at pdfdancer.com and grab your free API key from the dashboard.
Run Your First Script
Use the code examples above. Pass your API key as PDFDANCER_API_KEY environment variable.
Questions
Frequently Asked
Does it work with Express and Next.js?
Yes, absolutely. PDFDancer is framework-agnostic — it's just a Node.js library. Use it with Express middleware, Next.js API routes, or Fastify. See the code examples above for an Express middleware that handles file uploads and returns a redacted PDF.
Is it async/await compatible?
Yes. Every operation returns a Promise. Use async/await or .then() chains. The API is designed for modern Node.js patterns.
Can I use it in serverless (AWS Lambda)?
Yes. PDFDancer works in AWS Lambda, Google Cloud Functions, and Azure Functions. The SDK is stateless and designed for containerized environments. No dependency on GUI or native libraries. Total package size is under 5MB.
How does this compare to Apryse (PDFTron)?
Apryse is a full-featured SDK with true editing capabilities — but it comes with enterprise licensing ($10K+/year). PDFDancer offers the same core text editing (find, replace, reflow, redact) with a free tier and usage-based pricing. If you need annotation, form filling, or digital signatures, Apryse has a broader feature set. If you need text editing and redaction, PDFDancer is more affordable.
Is there a free tier?
Yes. You get 100 free PDF edits per month. Paid plans include higher limits, batch processing, and priority support. No credit card required to get started.
Start Using PDFDancer Today
Get started in seconds with our free tier. No credit card required.