SetImage
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. |
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 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);
ImageWatermarkOptions options = new ImageWatermarkOptions();
options.Scale = 50;
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.3.docx", watermarkImage, options);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.4.docx", SaveFormat.Docx, watermarkImage, options);
See Also
- 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. |
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 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);
ImageWatermarkOptions options = new ImageWatermarkOptions();
options.Scale = 50;
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.3.docx", watermarkImage, options);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.4.docx", SaveFormat.Docx, watermarkImage, options);
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 = null)
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. |
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 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);
ImageWatermarkOptions options = new ImageWatermarkOptions();
options.Scale = 50;
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.3.docx", watermarkImage, options);
Watermarker.SetImage(doc, ArtifactsDir + "LowCode.SetWatermarkText.4.docx", SaveFormat.Docx, watermarkImage, options);
See Also
- enum SaveFormat
- class ImageWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
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)
Parameter | Type | Description |
---|---|---|
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.
See Also
- class SaveOptions
- 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 = null)
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. |
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 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
SetImage(Stream, Stream, SaveOptions, Image, ImageWatermarkOptions)
Adds an image watermark into the document from streams with options.
public static void SetImage(Stream inputStream, Stream outputStream, SaveOptions saveOptions,
Image watermarkImage, ImageWatermarkOptions options = null)
Parameter | Type | Description |
---|---|---|
inputStream | Stream | The input stream. |
outputStream | Stream | The output stream. |
saveOptions | SaveOptions | The save options. |
watermarkImage | Image | 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), 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.
See Also
- class SaveOptions
- class ImageWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
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)
Parameter | Type | Description |
---|---|---|
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.
See Also
- enum SaveFormat
- class ImageWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words
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)
Parameter | Type | Description |
---|---|---|
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.
See Also
- class SaveOptions
- class ImageWatermarkOptions
- class Watermarker
- namespace Aspose.Words.LowCode
- assembly Aspose.Words