ImageWatermark Class

Represents a set of image watermark options used for document conversion.

Definition

Namespace: GleamTech.DocumentUltimate
Assembly: GleamTech.DocumentUltimate (in GleamTech.DocumentUltimate.dll) Version: 6.9.8
C#
public class ImageWatermark : Watermark
Inheritance
Object    Watermark    ImageWatermark

Constructors

ImageWatermarkInitializes a new instance of the ImageWatermark class.

Properties

AnnotationMode Gets or sets a value indicating if the watermark should be added as an annotation to a document page. Default is false. InBackground will not work with annotation mode. Note that enabling this property is currently not supported for DocumentViewer but it can be enabled when generating PDF documents directly via DocumentConverter.
(Inherited from Watermark)
DistanceIsPercentage Gets or sets a value indicating how to handle HorizontalDistance and VerticalDistance values. If true, HorizontalDistance is a percentage of the page width (e.g. 50 is 50% of the page width) and VerticalDistance is a percentage of the page height (e.g. 50 is 50% of the page height). If false, HorizontalDistance and VerticalDistance are measured in points.
(Inherited from Watermark)
Height Gets or sets the height of the watermark; in points or in percentage (e.g. 50 is 50% of the page height) if SizeIsPercentage is set to true. If also Width is specified, the resulting height may be smaller than the given one to maintain the aspect ratio. For text watermaks, only percentage values are accepted after setting SizeIsPercentage to true.
(Inherited from Watermark)
HorizontalAlignmentGets or sets a value indicating how the watermark is horizontally aligned relative to a document page.
(Inherited from Watermark)
HorizontalDistance Gets or sets the horizontal distance from left, right or center of document page; in points or in percentage (e.g. 50 is 50% of the page width) if DistanceIsPercentage is set to true.
(Inherited from Watermark)
Image Gets or sets the image file to use as watermark.

This property can be set to:

  • A plain string which contains a physical/virtual path
    (e.g. "c:\SomeFolder\SomeFile.ext", "/SomeFolder/SomeFile.ext", "~/SomeFolder/SomeFile.ext").

    This is parsed as a FileSystemFileProvider instance with a PhysicalLocation instance. Note that virtual paths can only be resolved in a web application.
    and on Linux paths starting with "/" are physical paths and not virtual paths.

  • A plain string which contains a URL or a Data URL.
    (e.g. "http://example.com/SomeFolder/SomeFile.ext", "data:image/gif;base64,...").

    Strings starting with http:// or https:// are parsed as a UrlFileProvider instance.
    Strings starting with data: are parsed as a DataUrlFileProvider instance.

  • A FileProvider instance created with one of the builtin file providers
    (e.g. FileSystemFileProvider, UrlFileProvider, DataUrlFileProvider, StreamFileProvider, MemoryFileProvider, DatabaseFileProvider, AssemblyResourceFileProvider, TemporaryFileProvider).

    You can also override FileProvider base class to implement your custom file provider.

  • A provider string which defines a specific file provider
    (e.g. "Type=FileSystem; File=SomeFile.ext; Location='Type=Physical; Path=c:\SomeFolder'").

The property only needs a readable file provider as it only calls GetInfo and OpenRead.

InBackground Gets or sets a value indicating if the watermark should be added as a background layer to a document page. Default is false.
(Inherited from Watermark)
Opacity Gets or sets the opacity of the watermark. Default is 100. Values are between 0 and 100. Value 0 is invisible, value 100 is fully visible.
(Inherited from Watermark)
PageRange Gets or sets the range of page numbers to add the watermark to. Default is "all". A string representation of number ranges (e.g. 1-5, 8, 11-13) or keywords (all, even, odd) can be directly assigned to this property.
(Inherited from Watermark)
PrintVisible Gets or sets a value indicating if the watermark should be displayed when printed. Default is true. Note that disabling this property is currently not supported for DocumentViewer but it can be disabled when generating PDF documents directly via DocumentConverter.
(Inherited from Watermark)
RotationGets or sets the rotation angle in degrees of the watermark.
(Inherited from Watermark)
ScreenVisible Gets or sets a value indicating if the watermark should be displayed on screen. Default is true. Note that disabling this property is currently not supported for DocumentViewer but it can be disabled when generating PDF documents directly via DocumentConverter.
(Inherited from Watermark)
SizeIsPercentage Gets or sets a value indicating how to handle Width and Height values. If true, Width is a percentage of the page width (e.g. 50 is 50% of the page width) and Height is a percentage of the page height (e.g. 50 is 50% of the page height). If false, Width and Height are measured in points.
(Inherited from Watermark)
VerticalAlignmentGets or sets a value indicating how the watermark is vertically aligned relative to a document page.
(Inherited from Watermark)
VerticalDistance Gets or sets the vertical distance from top, bottom or center of document page; in points or in percentage (e.g. 50 is 50% of the page height) if DistanceIsPercentage is set to true.
(Inherited from Watermark)
Width Gets or sets the width of the watermark; in points or in percentage (e.g. 50 is 50% of the page width) if SizeIsPercentage is set to true. If also Height is specified, the resulting width may be smaller than the given one to maintain the aspect ratio. For text watermaks, only percentage values are accepted after setting SizeIsPercentage to true.
(Inherited from Watermark)

See Also