Watermarker.SetText
SetText(string, string, string)
Adds Text watermark into the document.
public static void SetText(string inputFileName, string outputFileName, string watermarkText)
Parameter | Type | Description |
---|---|---|
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.
Examples
Shows how to add text watermark in the document.
Watermarker.SetText(MyDir + "Simple.docx", ArtifactsDir + "Watermarker.SetText.docx", "Wordize");
See Also
- class Watermarker
- namespace Wordize.Watermarking
- assembly Wordize
SetText(string, string, string, TextWatermarkOptions)
Adds Text watermark into the document.
public static void SetText(string inputFileName, string outputFileName, string watermarkText,
TextWatermarkOptions options = null)
Parameter | Type | Description |
---|---|---|
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.
Examples
Shows how to add text watermark in the document with custom text watermark options.
TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions();
textWatermarkOptions.FontFamily = "Arial";
textWatermarkOptions.FontSize = 48;
textWatermarkOptions.IsSemitrasparent = false;
textWatermarkOptions.Color = Color.Red;
textWatermarkOptions.Layout = WatermarkLayout.Horizontal;
Watermarker.SetText(MyDir + "Simple.docx", ArtifactsDir + "Watermarker.SetText.pdf", "Wordize", textWatermarkOptions);
See Also
- class TextWatermarkOptions
- class Watermarker
- namespace Wordize.Watermarking
- assembly Wordize
SetText(string, string, SaveFormat, string, TextWatermarkOptions)
Adds Text watermark into the document.
public static void SetText(string inputFileName, string outputFileName, SaveFormat saveFormat,
string watermarkText, TextWatermarkOptions options = null)
Parameter | Type | Description |
---|---|---|
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.
Examples
Shows how to add text watermark in the document with custom text watermark options and save result in explicitly set save format.
TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions();
textWatermarkOptions.Color = Color.Red;
Watermarker.SetText(MyDir + "Simple.docx", ArtifactsDir + "Watermarker.SetText.xps", SaveFormat.Xps, "Wordize", textWatermarkOptions);
See Also
- enum SaveFormat
- class TextWatermarkOptions
- class Watermarker
- namespace Wordize.Watermarking
- assembly Wordize
SetText(Stream, Stream, SaveFormat, string, TextWatermarkOptions)
Adds Text watermark into the document.
public static void SetText(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
string watermarkText, TextWatermarkOptions options = null)
Parameter | Type | Description |
---|---|---|
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.
Examples
Shows how to add text watermark in the document using streams.
TextWatermarkOptions textWatermarkOptions = new TextWatermarkOptions();
textWatermarkOptions.Color = Color.Red;
using (Stream input = File.OpenRead(MyDir + "Simple.docx"))
using (Stream output = File.Create(ArtifactsDir + "Watermarker.SetText.rtf"))
{
Watermarker.SetText(input, output, SaveFormat.Rtf, "Wordize", textWatermarkOptions);
}
See Also
- enum SaveFormat
- class TextWatermarkOptions
- class Watermarker
- namespace Wordize.Watermarking
- assembly Wordize