pdf-zusammenfuegen
v1.0.0
Published
Minimal utility for merging PDF files entirely in the browser or on Node.js using pdf-lib.
Readme
pdf-zusammenfuegen
Minimal utility to merge PDF files offline, fully in the browser or in Node.js, without uploading documents.
Installation
npm install pdf-zusammenfuegen
# or
pnpm add pdf-zusammenfuegenAPI
mergePdfs(inputs: MergePdfSource[]): Promise<Uint8Array>
inputs: Array of objects withdata(anyArrayBuffer, typed view,Blob, or{ arrayBuffer(): Promise<ArrayBuffer> }) and optionalpageRange("1-4,7,10-12").- Returns a
Uint8Arraycontaining the merged PDF bytes. - Works entirely in memory; no uploads are performed.
import { mergePdfs, createBlob } from "pdf-zusammenfuegen";
const files = [
{ data: firstFile, pageRange: "1-3" },
{ data: secondFile }
];
const bytes = await mergePdfs(files);
const blob = createBlob(bytes);createBlob(bytes: Uint8Array): Blob
Creates a download-ready Blob for the merged PDF when running in a browser.
Features
- Privacy-first: runs client-side with
pdf-lib, so sensitive files never leave the device. - Supports page-range selection and re-ordering through the order of the input array.
- Compatible with browsers and Node.js (when supplied with
ArrayBufferor typed arrays).
Build
npm run buildOutputs compiled ESM to dist/ with type declarations.
Security & Privacy Notes
All processing happens locally or in your own Node.js process; no telemetry, uploads, or tracking are involved. This matches the GDPR-compliant, offline-first goals of the broader pdfzusammenfügen toolset.
