Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Last active June 12, 2025 12:19
Show Gist options
  • Save GroupDocsGists/1dd3e04dd9ccff5bb39dcdcf6ed5d30e to your computer and use it in GitHub Desktop.
Save GroupDocsGists/1dd3e04dd9ccff5bb39dcdcf6ed5d30e to your computer and use it in GitHub Desktop.
How To Add Image Watermark to a Document in Node.js solutions

How To Add Image Watermark to a Document in Node.js Solutions

Looking to protect documents with watermarks in your Node.js applications? This example demonstrates exactly how to add image watermark to a document in Node.js using the GroupDocs.Watermark Cloud SDK.

You’ll learn how to implement document security, enforce content protection with watermarking, and use watermark automation for enterprise workflowsβ€”all programmatically with JavaScript.

βœ… This Node.js example answers the question: How to watermark files with a custom image in Node.js?


🧩 Features Demonstrated

  • Apply image-based watermark to any document format (PDF, DOCX, XLSX, PPTX, etc.)
  • Customize watermark size, position, and rotation
  • Works with local files and cloud storage
  • Scalable for enterprise watermark automation

βœ… Steps to Add Image Watermark in Node.js

  1. Install GroupDocs.Watermark Cloud SDK for Node.js
  2. Upload your document and watermark image to cloud storage
  3. Configure watermark settings (position, rotation, size)
  4. Call API to apply the watermark
  5. Download the watermarked document

πŸ’» Node.js Code Example – Add Image Watermark

See the addImageWatermark.js file for the full code sample.


πŸ” SEO Keywords for Developers

This guide helps Node.js developers:

  • Add watermark or create watermark in JavaScript apps
  • Use custom watermark images with custom fonts
  • Implement invisible watermarking for documents
  • Enable document security for DOCX, PDF, and more
  • Learn how to watermark files in the cloud

Also useful for searches like:

  • How to remove watermark from a document
  • Remove watermark in Node.js
  • Delete watermark from PDF/Word
  • How to remove watermark from free tools
  • Removing watermark from documents programmatically

πŸ”— Related Blog Article


πŸ“¦ About GroupDocs.Watermark Cloud API

GroupDocs.Watermark Cloud is a REST API solution for applying, searching, and removing watermarks across multiple document and image formats. SDKs are available for Node.js, Python, Java, PHP, and more.


πŸ›  Try It Yourself

Install the SDK using npm:

npm install groupdocs-watermark-cloud
// require the GroupDocs.Watermark module
const groupdocsWatermark = require('@groupdocs/groupdocs.watermark')
// Initialize the Watermarker class
const watermarker = new groupdocsWatermark.Watermarker(inDocumentPath);
// Create an Image Watermark
const imageWatermark = new groupdocsWatermark.ImageWatermark(imageFilePath);
// Set Watermark Alignment
imageWatermark.setHorizontalAlignment(groupdocsWatermark.HorizontalAlignment.Center);
imageWatermark.setVerticalAlignment(groupdocsWatermark.VerticalAlignment.Center);
// Add the Watermark to the Document
watermarker.add(imageWatermark);
// Save the Watermarked Document
watermarker.save(outDocumentPath);
// Close the Watermarker
watermarker.close();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment