Class Watermarker
Namespace: Aspose.Words.LowCode
Assembly: Aspose.Words.dll (25.8.0)
Provides methods intended to insert watermarks into the documents.
public class Watermarker : ProcessorInheritance
object ← Processor ← Watermarker
Inherited Members
Processor.mResultDocument , Processor.From(string, LoadOptions) , Processor.From(Stream, LoadOptions) , Processor.To(string, SaveOptions) , Processor.To(string, SaveFormat) , Processor.To(Stream, SaveOptions) , Processor.To(Stream, SaveFormat) , Processor.To(List<stream>, SaveOptions) , Processor.To(List<stream>, SaveFormat) , Processor.Execute() , Processor.ExecuteCore() , Processor.CheckArgumentsSet() , Processor.GetPartFileName(string, int, SaveFormat) , object.GetType() , object.MemberwiseClone() , object.ToString() , object.Equals(object?) , object.Equals(object?, object?) , object.ReferenceEquals(object?, object?) , object.GetHashCode()
Methods
CheckArgumentsSet()
protected override void CheckArgumentsSet()Create(WatermarkerContext)
Creates new instance of the watermarker processor.
public static Watermarker Create(WatermarkerContext context)Parameters
context WatermarkerContext
Returns
ExecuteCore()
protected override void ExecuteCore()SetImage(string, string, string)
Adds an image watermark into the document.
public static void SetImage(string inputFileName, string outputFileName, string watermarkImageFileName)Parameters
inputFileName string
The input file name.
outputFileName string
The output file name.
watermarkImageFileName string
Image that is displayed as a watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
SetImage(string, string, string, ImageWatermarkOptions)
Adds an image watermark into the document with options.
public static void SetImage(string inputFileName, string outputFileName, string watermarkImageFileName, ImageWatermarkOptions options)Parameters
inputFileName string
The input file name.
outputFileName string
The output file name.
watermarkImageFileName string
Image that is displayed as a watermark.
options ImageWatermarkOptions
Defines additional options for the image watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
SetImage(string, string, SaveFormat, string, ImageWatermarkOptions)
Adds an image watermark into the document with options and specified save format.
public static void SetImage(string inputFileName, string outputFileName, SaveFormat saveFormat, string watermarkImageFileName, ImageWatermarkOptions options = null)Parameters
inputFileName string
The input file name.
outputFileName string
The output file name.
saveFormat SaveFormat
The save format.
watermarkImageFileName string
Image that is displayed as a watermark.
options ImageWatermarkOptions
Defines additional options for the image watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
SetImage(string, string, SaveOptions, string, ImageWatermarkOptions)
Adds an image watermark into the document with options and specified save format.
public static void SetImage(string inputFileName, string outputFileName, SaveOptions saveOptions, string watermarkImageFileName, ImageWatermarkOptions options = null)Parameters
inputFileName string
The input file name.
outputFileName string
The output file name.
saveOptions SaveOptions
The save options.
watermarkImageFileName string
Image that is displayed as a watermark.
options ImageWatermarkOptions
Defines additional options for the image watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
SetImage(Stream, Stream, SaveFormat, SKBitmap, ImageWatermarkOptions)
[CLSCompliant(false)]
public static void SetImage(Stream inputStream, Stream outputStream, SaveFormat saveFormat, SKBitmap watermarkImage, ImageWatermarkOptions options = null)Parameters
inputStream Stream
outputStream Stream
saveFormat SaveFormat
watermarkImage SKBitmap
options ImageWatermarkOptions
SetImage(Stream, Stream, SaveOptions, SKBitmap, ImageWatermarkOptions)
[CLSCompliant(false)]
public static void SetImage(Stream inputStream, Stream outputStream, SaveOptions saveOptions, SKBitmap watermarkImage, ImageWatermarkOptions options = null)Parameters
inputStream Stream
outputStream Stream
saveOptions SaveOptions
watermarkImage SKBitmap
options ImageWatermarkOptions
SetImage(Stream, Stream, SaveFormat, Stream, ImageWatermarkOptions)
Adds an image watermark into the document from streams with options.
public static void SetImage(Stream inputStream, Stream outputStream, SaveFormat saveFormat, Stream watermarkImageStream, ImageWatermarkOptions options = null)Parameters
inputStream Stream
The input stream.
outputStream Stream
The output stream.
saveFormat SaveFormat
The save format.
watermarkImageStream Stream
Image stream that is displayed as a watermark.
options ImageWatermarkOptions
Defines additional options for the image watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
SetImage(Stream, Stream, SaveOptions, Stream, ImageWatermarkOptions)
Adds an image watermark into the document from streams with options.
public static void SetImage(Stream inputStream, Stream outputStream, SaveOptions saveOptions, Stream watermarkImageStream, ImageWatermarkOptions options = null)Parameters
inputStream Stream
The input stream.
outputStream Stream
The output stream.
saveOptions SaveOptions
The save options.
watermarkImageStream Stream
Image stream that is displayed as a watermark.
options ImageWatermarkOptions
Defines additional options for the image watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
SetText(string, string, string)
Adds a text watermark into the document.
public static void SetText(string inputFileName, string outputFileName, string watermarkText)Parameters
inputFileName string
The input file name.
outputFileName string
The output file name.
watermarkText string
Text that is displayed as a watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
SetText(string, string, string, TextWatermarkOptions)
Adds a text watermark into the document with options.
public static void SetText(string inputFileName, string outputFileName, string watermarkText, TextWatermarkOptions options)Parameters
inputFileName string
The input file name.
outputFileName string
The output file name.
watermarkText string
Text that is displayed as a watermark.
options TextWatermarkOptions
Defines additional options for the text watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
SetText(string, string, SaveFormat, string, TextWatermarkOptions)
Adds a text watermark into the document with options and specified save format.
public static void SetText(string inputFileName, string outputFileName, SaveFormat saveFormat, string watermarkText, TextWatermarkOptions options = null)Parameters
inputFileName string
The input file name.
outputFileName string
The output file name.
saveFormat SaveFormat
The save format.
watermarkText string
Text that is displayed as a watermark.
options TextWatermarkOptions
Defines additional options for the text watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
SetText(string, string, SaveOptions, string, TextWatermarkOptions)
Adds a text watermark into the document with options and specified save format.
public static void SetText(string inputFileName, string outputFileName, SaveOptions saveOptions, string watermarkText, TextWatermarkOptions options = null)Parameters
inputFileName string
The input file name.
outputFileName string
The output file name.
saveOptions SaveOptions
The save options.
watermarkText string
Text that is displayed as a watermark.
options TextWatermarkOptions
Defines additional options for the text watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), each page of the output will be saved as a separate file. The specified output file name will be used to generate file names for each part following the rule: outputFile_partIndex.extension.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF file.
SetText(Stream, Stream, SaveFormat, string, TextWatermarkOptions)
Adds a text watermark into the document from streams with options.
public static void SetText(Stream inputStream, Stream outputStream, SaveFormat saveFormat, string watermarkText, TextWatermarkOptions options = null)Parameters
inputStream Stream
The input stream.
outputStream Stream
The output stream.
saveFormat SaveFormat
The save format.
watermarkText string
Text that is displayed as a watermark.
options TextWatermarkOptions
Defines additional options for the text watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
SetText(Stream, Stream, SaveOptions, string, TextWatermarkOptions)
Adds a text watermark into the document from streams with options.
public static void SetText(Stream inputStream, Stream outputStream, SaveOptions saveOptions, string watermarkText, TextWatermarkOptions options = null)Parameters
inputStream Stream
The input stream.
outputStream Stream
The output stream.
saveOptions SaveOptions
The save options.
watermarkText string
Text that is displayed as a watermark.
options TextWatermarkOptions
Defines additional options for the text watermark.
Remarks
If the output format is an image (BMP, EMF, EPS, GIF, JPEG, PNG, or WebP), only the first page of the output will be saved to the specified stream.
If the output format is TIFF, the output will be saved as a single multi-frame TIFF to the specified stream.
SetWatermarkToImages(string, ImageSaveOptions, string, TextWatermarkOptions)
Adds a text watermark into the document with options. Renders the output to images.
public static Stream[] SetWatermarkToImages(string inputFileName, ImageSaveOptions saveOptions, string watermarkText, TextWatermarkOptions options = null)Parameters
inputFileName string
The input file name.
saveOptions ImageSaveOptions
The save options.
watermarkText string
Text that is displayed as a watermark.
options TextWatermarkOptions
Defines additional options for the text watermark.
Returns
Stream []
SetWatermarkToImages(Stream, ImageSaveOptions, string, TextWatermarkOptions)
Adds a text watermark into the document with options. Renders the output to images.
public static Stream[] SetWatermarkToImages(Stream inputStream, ImageSaveOptions saveOptions, string watermarkText, TextWatermarkOptions options = null)Parameters
inputStream Stream
The input file stream.
saveOptions ImageSaveOptions
The save options.
watermarkText string
Text that is displayed as a watermark.
options TextWatermarkOptions
Defines additional options for the text watermark.
Returns
Stream []
SetWatermarkToImages(string, ImageSaveOptions, byte[], ImageWatermarkOptions)
Adds an image watermark into the document with options. Renders the output to images.
public static Stream[] SetWatermarkToImages(string inputFileName, ImageSaveOptions saveOptions, byte[] watermarkImageBytes, ImageWatermarkOptions options = null)Parameters
inputFileName string
The input file name.
saveOptions ImageSaveOptions
The save options.
watermarkImageBytes byte
[]
Image bytes that is displayed as a watermark.
options ImageWatermarkOptions
Defines additional options for the image watermark.
Returns
Stream []
SetWatermarkToImages(Stream, ImageSaveOptions, Stream, ImageWatermarkOptions)
Adds an image watermark into the document with options. Renders the output to images.
public static Stream[] SetWatermarkToImages(Stream inputStream, ImageSaveOptions saveOptions, Stream watermarkImageStream, ImageWatermarkOptions options = null)Parameters
inputStream Stream
The input stream.
saveOptions ImageSaveOptions
The save options.
watermarkImageStream Stream
Image stream that is displayed as a watermark.
options ImageWatermarkOptions
Defines additional options for the image watermark.
Returns
Stream [] </stream></stream>