Related Article(s):
Last active
May 22, 2024 21:04
-
-
Save GroupDocsGists/7304eb793d9916a5c40825f89841b964 to your computer and use it in GitHub Desktop.
Simple Example of GroupDocs.Watermark for Node.js via Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// require the GroupDocs.Watermark module | |
const groupdocsWatermark = require('@groupdocs/groupdocs.watermark') | |
// Initialize the watermarker object | |
const watermarker = new groupdocsWatermark.Watermarker('Example.docx'); | |
// Create the font object which will be used for the watermark text | |
const font = new groupdocsWatermark.Font('Arial', 36, groupdocsWatermark.FontStyle.Bold); | |
// Instantiate the watermark class | |
const watermark = new groupdocsWatermark.TextWatermark('Test watermark', font); | |
// Add watermark with the watermarker object | |
watermarker.add(watermark); | |
// Save new document with the watermark added | |
watermarker.save('outFile.docx'); | |
// Close the watermarker object to finalize properly | |
watermarker.close(); | |
console.log('Watermark added and document saved successfully.'); | |
process.exit(0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment