Save document to the specified stream
Following code shows usage of Save(Stream) method.
AdvancedUsage.SavingDocuments.SaveDocumentToTheSpecifiedStream
// Constants.InTestDoc is an absolute or relative path to your document. Ex: @"C:\Docs\test.doc"
using (Watermarker watermarker = new Watermarker(Constants.InTestDoc))
{
// watermarking goes here
TextWatermark watermark = new TextWatermark("Test watermark", new Font("Arial", 12));
watermarker.Add(watermark);
// Saves the document to the specified stream
watermarker.Save(stream);
}
More resources
GitHub examples
You may easily run the code above and see the feature in action in our GitHub examples:
Free online document watermarking App
Along with full featured .NET library we provide simple, but powerful free Apps.
You are welcome to add watermark to PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX, Emails and more with our free online Free Online Document Watermarking App.