JPG to PDF in the browserjs import { PDFDocument } from "pdf-lib"; async function imagesToPdf(files) { const pdf = await PDFDocument.create(); for (const file of files) { const bytes = await file.arrayBuffer(); c1 min read·toolsdzire.hashnode.dev3d ago
Compress an image to an exact size (like 100 KB) with binary searchOnline forms often demand “under 100 KB”. Instead of guessing a quality value, binary-search it.1 min read·toolsdzire.hashnode.dev3d ago
Resizing images in the browser without ugly resultsBefore compressing, resize. Dimensions affect file size more than quality does.1 min read·toolsdzire.hashnode.dev3d ago
Merge PDFs in the browser with pdf-libMost online PDF mergers upload your files to a server. You can do it entirely client-side with pdf-lib, so private documents never leave the device.1 min read·toolsdzire.hashnode.dev3d ago