Server-Side PDF Encryption with pikepdf in a Next.js App (No qpdf Required)
python
dev.to
Most of our tools at Ultimate Tools run entirely in the browser — pdf-lib for merging, Canvas API for image compression, marked.js for Markdown conversion. But PDF password protection is one feature that cannot run client-side. Here's how we implemented AES-256 PDF encryption using pikepdf (Python) called from a Next.js API route, and the problems we solved along the way. Why Not Client-Side? JavaScript has no reliable library for PDF encryption. The PDF spec's encryption standar