SetText
Contents
[
Hide
]SetText(string, string, string)
Adds a 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. |
Examples
Shows how to insert watermark text to the document.
string doc = MyDir + "Big document.docx";
string watermarkText = "This is a watermark";
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.1.docx", watermarkText);
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.2.docx", SaveFormat.Docx, watermarkText);
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.3.docx", watermarkText, new TextWatermarkOptions() { Color = Color.Red });
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.4.docx", SaveFormat.Docx, watermarkText, new TextWatermarkOptions() { Color = Color.Red });
See Also
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
SetText(string, string, SaveFormat, string)
Adds a text watermark into the document with specified save format.
public static void SetText(string inputFileName, string outputFileName, SaveFormat saveFormat,
string watermarkText)
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. |
Examples
Shows how to insert watermark text to the document.
string doc = MyDir + "Big document.docx";
string watermarkText = "This is a watermark";
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.1.docx", watermarkText);
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.2.docx", SaveFormat.Docx, watermarkText);
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.3.docx", watermarkText, new TextWatermarkOptions() { Color = Color.Red });
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.4.docx", SaveFormat.Docx, watermarkText, new TextWatermarkOptions() { Color = Color.Red });
See Also
- enum SaveFormat
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
SetText(Stream, Stream, SaveFormat, string)
Adds a text watermark into the document from streams.
public static void SetText(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
string watermarkText)
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. |
Examples
Shows how to insert watermark text to the document from the stream.
string watermarkText = "This is a watermark";
using (FileStream streamIn = new FileStream(MyDir + "Document.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.WatermarkTextStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
Watermarker.SetText(streamIn, streamOut, SaveFormat.Docx, watermarkText);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.WatermarkTextStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
Watermarker.SetText(streamIn, streamOut, SaveFormat.Docx, watermarkText, new TextWatermarkOptions() { Color = Color.Red });
}
See Also
- enum SaveFormat
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
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)
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. |
Examples
Shows how to insert watermark text to the document.
string doc = MyDir + "Big document.docx";
string watermarkText = "This is a watermark";
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.1.docx", watermarkText);
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.2.docx", SaveFormat.Docx, watermarkText);
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.3.docx", watermarkText, new TextWatermarkOptions() { Color = Color.Red });
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.4.docx", SaveFormat.Docx, watermarkText, new TextWatermarkOptions() { Color = Color.Red });
See Also
- class TextWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
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)
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. |
Examples
Shows how to insert watermark text to the document.
string doc = MyDir + "Big document.docx";
string watermarkText = "This is a watermark";
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.1.docx", watermarkText);
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.2.docx", SaveFormat.Docx, watermarkText);
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.3.docx", watermarkText, new TextWatermarkOptions() { Color = Color.Red });
Watermarker.SetText(doc, ArtifactsDir + "LowCode.WatermarkText.4.docx", SaveFormat.Docx, watermarkText, new TextWatermarkOptions() { Color = Color.Red });
See Also
- enum SaveFormat
- class TextWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
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)
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. |
Examples
Shows how to insert watermark text to the document from the stream.
string watermarkText = "This is a watermark";
using (FileStream streamIn = new FileStream(MyDir + "Document.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.WatermarkTextStream.1.docx", FileMode.Create, FileAccess.ReadWrite))
Watermarker.SetText(streamIn, streamOut, SaveFormat.Docx, watermarkText);
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.WatermarkTextStream.2.docx", FileMode.Create, FileAccess.ReadWrite))
Watermarker.SetText(streamIn, streamOut, SaveFormat.Docx, watermarkText, new TextWatermarkOptions() { Color = Color.Red });
}
See Also
- enum SaveFormat
- class TextWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words