Forum Discussion
Braunschweig1055
May 15, 2024Copper Contributor
How can I add watermarks to PDF documents in batch on my win 11?
I'm looking for a way to add watermarks to multiple PDF documents in batch. I often need to process several documents at once, branding them with either my company's logo or some text before sending ...
Dvoraky
Mar 07, 2025Iron Contributor
pdftk is an open source , cross-platform command-line PDF tool that supports merging, splitting, rotating, encrypting, watermarking and other operations , powerful and completely free. It can complete complex tasks through simple command-line parameters , without a graphical interface , suitable for batch processing of documents or automated script calls . Although pdftk itself does not directly embed image watermarks, but can be realized through the following combinations:
- Combine ImagieMagick to generate watermarked PDF pages and pdftk to merge the pages.
- Use pdftk's shuffle function to disrupt the page order, or merge multiple PDF pages with the cat command.
Below is an helpful script to add watermarks to pdf file:
const PDFDocument = require('pdfkit');
const fs = require('fs');
const doc = new PDFDocument({
size: [595, 842],
margins: { top: 100, bottom: 100, left: 100, right: 100 }
});
const logo = fs.readFileSync('logo.png');
doc.image(logo, 100, 100, { width: 200, height: 200 });
doc.text('content', 100, 300);
doc.pipe(fs.createWriteStream('output.pdf'));
doc.end();
If you need to directly embed the image watermark, it is recommended to use with ImagieMagick, pdftk is more suitable for PDF post-processing as an auxiliary tool.