SetImage
Contents
[
Hide
]SetImage(string, string, string)
Adds an image watermark into the document.
public static void SetImage(string inputFileName, string outputFileName,
string watermarkImageFileName)
Parameter | Type | Description |
---|---|---|
inputFileName | String | The input file name. |
outputFileName | String | The output file name. |
watermarkImageFileName | String | Image that is displayed as a watermark. |
Examples
Shows how to insert watermark image to the document.
string doc = MyDir + "Document.docx";
string watermarkImage = ImageDir + "Logo.jpg";
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkImage.1.docx", watermarkImage);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.2.docx", SaveFormat.Docx, watermarkImage);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.3.docx", watermarkImage, new ImageWatermarkOptions() { Scale = 50 });
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.4.docx", SaveFormat.Docx, watermarkImage, new ImageWatermarkOptions() { Scale = 50 });
See Also
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
SetImage(string, string, SaveFormat, string)
Adds an image watermark into the document with specified save format.
public static void SetImage(string inputFileName, string outputFileName, SaveFormat saveFormat,
string watermarkImageFileName)
Parameter | Type | Description |
---|---|---|
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. |
Examples
Shows how to insert watermark image to the document.
string doc = MyDir + "Document.docx";
string watermarkImage = ImageDir + "Logo.jpg";
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkImage.1.docx", watermarkImage);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.2.docx", SaveFormat.Docx, watermarkImage);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.3.docx", watermarkImage, new ImageWatermarkOptions() { Scale = 50 });
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.4.docx", SaveFormat.Docx, watermarkImage, new ImageWatermarkOptions() { Scale = 50 });
See Also
- enum SaveFormat
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
SetImage(Stream, Stream, SaveFormat, Image)
Adds an image watermark into the document from streams.
public static void SetImage(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
Image watermarkImage)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input stream. |
outputStream | Stream | The output stream. |
saveFormat | SaveFormat | The save format. |
watermarkImage | Image | Image that is displayed as a watermark. |
Examples
Shows how to insert watermark image to the document from a stream.
using (FileStream streamIn = new FileStream(MyDir + "Document.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.SetWatermarkText.1.docx", FileMode.Create, FileAccess.ReadWrite))
Watermarker.SetImage(streamIn, streamOut, SaveFormat.Docx, System.Drawing.Image.FromFile(ImageDir + "Logo.jpg"));
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.SetWatermarkText.2.docx", FileMode.Create, FileAccess.ReadWrite))
Watermarker.SetImage(streamIn, streamOut, SaveFormat.Docx, System.Drawing.Image.FromFile(ImageDir + "Logo.jpg"), new ImageWatermarkOptions() { Scale = 50 });
}
See Also
- enum SaveFormat
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
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)
Parameter | Type | Description |
---|---|---|
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. |
Examples
Shows how to insert watermark image to the document.
string doc = MyDir + "Document.docx";
string watermarkImage = ImageDir + "Logo.jpg";
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkImage.1.docx", watermarkImage);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.2.docx", SaveFormat.Docx, watermarkImage);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.3.docx", watermarkImage, new ImageWatermarkOptions() { Scale = 50 });
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.4.docx", SaveFormat.Docx, watermarkImage, new ImageWatermarkOptions() { Scale = 50 });
See Also
- class ImageWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
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)
Parameter | Type | Description |
---|---|---|
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. |
Examples
Shows how to insert watermark image to the document.
string doc = MyDir + "Document.docx";
string watermarkImage = ImageDir + "Logo.jpg";
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkImage.1.docx", watermarkImage);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.2.docx", SaveFormat.Docx, watermarkImage);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.3.docx", watermarkImage, new ImageWatermarkOptions() { Scale = 50 });
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.4.docx", SaveFormat.Docx, watermarkImage, new ImageWatermarkOptions() { Scale = 50 });
See Also
- enum SaveFormat
- class ImageWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
SetImage(Stream, Stream, SaveFormat, Image, ImageWatermarkOptions)
Adds an image watermark into the document from streams with options.
public static void SetImage(Stream inputStream, Stream outputStream, SaveFormat saveFormat,
Image watermarkImage, ImageWatermarkOptions options)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input stream. |
outputStream | Stream | The output stream. |
saveFormat | SaveFormat | The save format. |
watermarkImage | Image | Image that is displayed as a watermark. |
options | ImageWatermarkOptions | Defines additional options for the image watermark. |
Examples
Shows how to insert watermark image to the document from a stream.
using (FileStream streamIn = new FileStream(MyDir + "Document.docx", FileMode.Open, FileAccess.Read))
{
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.SetWatermarkText.1.docx", FileMode.Create, FileAccess.ReadWrite))
Watermarker.SetImage(streamIn, streamOut, SaveFormat.Docx, System.Drawing.Image.FromFile(ImageDir + "Logo.jpg"));
using (FileStream streamOut = new FileStream(ArtifactsDir + "LowCode.SetWatermarkText.2.docx", FileMode.Create, FileAccess.ReadWrite))
Watermarker.SetImage(streamIn, streamOut, SaveFormat.Docx, System.Drawing.Image.FromFile(ImageDir + "Logo.jpg"), new ImageWatermarkOptions() { Scale = 50 });
}
See Also
- enum SaveFormat
- class ImageWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words