How-To GuidesMarch 16, 2026
Meidy Baffou·LazyPDF

How to Watermark a PDF on Linux: Browser and Command-Line Methods

Adding a watermark to a PDF on Linux is achievable through several approaches depending on your workflow. The browser-based method works without any installation and is ideal for one-off watermarking tasks. For recurring needs or batch processing, Linux's command-line tools offer scriptable solutions. Watermarks serve several legitimate purposes: marking draft documents as non-final, branding shared documents with your company name, adding 'CONFIDENTIAL' labels to sensitive materials, and deterring unauthorized redistribution by marking documents with the recipient's name. Linux users have more native options than users on other platforms, but the browser-based approach remains the quickest for most scenarios. This guide covers both approaches in practical detail.

Watermarking a PDF in the Browser (Fastest Method)

The quickest way to add a watermark on Linux is through a browser-based tool. This requires no package installation, works on any Linux distribution, and handles the processing server-side so your Chromebook's CPU isn't doing any heavy lifting.

  1. 1Open your browser (Firefox, Chromium, or any browser on your system)
  2. 2Navigate to lazy-pdf.com/watermark
  3. 3Upload your PDF by clicking the upload area or dragging the file in
  4. 4Type your watermark text (DRAFT, CONFIDENTIAL, your company name, etc.)
  5. 5Choose the watermark style: text color, opacity, rotation angle, and position
  6. 6Preview if available, then apply the watermark
  7. 7Download the watermarked PDF

Watermarking with Ghostscript on Linux

Ghostscript is a powerful open-source PDF interpreter that's available in most Linux package repositories. It can add text overlays to PDF pages, which is the technical equivalent of a watermark. Install Ghostscript if not present: `sudo apt install ghostscript` (Ubuntu/Debian) or `sudo dnf install ghostscript` (Fedora). The Ghostscript approach involves writing a PostScript fragment that draws your watermark text on each page during PDF processing. While more complex than the browser approach, it's scriptable and can be integrated into automated document workflows. The basic command renders the watermark as transformed, semi-transparent text at the position you specify in the PostScript fragment. For users who need to watermark PDFs as part of a larger workflow (processing documents coming from a specific directory, for example), a shell script wrapping Ghostscript commands handles batch watermarking efficiently.

  1. 1Install Ghostscript: sudo apt install ghostscript
  2. 2Create a watermark PostScript file (wm.ps) containing your watermark definition and text
  3. 3Run gs with: gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=output.pdf wm.ps input.pdf
  4. 4Verify the output by opening it in a PDF viewer
  5. 5Adjust the PostScript file to modify position, size, or opacity as needed

Using pdftk with a Stamp PDF

pdftk supports a 'stamp' operation that overlays one PDF on top of another. To use this for watermarking, you first create a watermark PDF — a single-page PDF containing just your watermark text or image — and then use pdftk to apply it as a stamp across all pages of the target document. Creating the watermark PDF can be done with Inkscape (open source vector editor), LibreOffice Writer, or any application that can export to PDF. Create a document with the watermark text styled exactly as you want it (diagonal, semi-transparent, at the desired font size), export it as a single-page PDF, and then use pdftk's stamp operation. This two-step approach gives you excellent visual control over the watermark appearance while using standard Linux tools.

Batch Watermarking Multiple PDFs on Linux

If you need to watermark many PDFs at once — marking all documents in a directory as CONFIDENTIAL before distribution, for example — a shell script is the most efficient approach on Linux. A simple bash script loops through all PDF files in a directory, runs the Ghostscript watermark command on each, and saves the watermarked versions to an output directory. This can process hundreds of documents automatically without manual intervention. For recurring use, the script can be scheduled as a cron job or integrated into a larger document processing pipeline. This kind of automation is one of Linux's genuine advantages over other platforms for document management.

Choosing Between Visual and Structural Watermarks

A visual watermark — text or image overlaid on the PDF page — is what most people think of when they think watermarks. It's visible when the document is opened and can be seen in print. This is the type that browser tools and Ghostscript apply. A structural or metadata-based watermark embeds information within the PDF's metadata or invisible layers rather than on the visible page content. This type is harder to casually remove but requires more specialized tools to apply. For most purposes — marking drafts, protecting sensitive documents, branding shared content — a visual watermark applied with any of the methods above is entirely sufficient. The browser-based tool at LazyPDF produces visually clean watermarks with adjustable opacity and rotation.

Frequently Asked Questions

Can I add an image watermark (like a logo) to a PDF on Linux?

LazyPDF's watermark tool supports text watermarks. For image (logo) watermarks, the pdftk stamp approach is the most practical on Linux — create a stamp PDF with your logo positioned and styled as desired (using Inkscape or LibreOffice), then stamp it onto your document with pdftk. Ghostscript can also handle image content in PostScript overlays for more advanced users.

How do I make the watermark semi-transparent so it doesn't obscure the document text?

In LazyPDF's browser tool, the opacity setting controls transparency — lower opacity makes the watermark more transparent so underlying text remains readable. In Ghostscript, opacity is controlled through the PostScript setgray or setrgbcolor commands with values between 0 (transparent) and 1 (opaque). A value around 0.2–0.3 produces a typical semi-transparent watermark effect.

Will the watermark I add be permanent, or can it be removed?

Visual watermarks applied as overlays are part of the PDF's rendered page content. They cannot be trivially removed by end users without PDF editing tools. However, technically capable users with advanced PDF editing software can sometimes remove overlay-based watermarks. For truly secure document protection, combine visible watermarks with other security measures like password protection.

Can I watermark a PDF from the Linux command line without a GUI?

Yes — both Ghostscript and pdftk run entirely from the command line without requiring a desktop environment. This makes them suitable for headless Linux servers, SSH sessions, and automated scripts. The browser-based tool requires a browser (which requires a desktop environment), but all command-line methods work in terminal-only environments.

Add a professional watermark to your PDF on Linux — browser method works without any installation in seconds.

Watermark a PDF

Related Articles