Watermarker

Watermarker class

Represents a class for watermark management in a document.

public class Watermarker : IDisposable

Constructors

Name Description
Watermarker(Stream) Initializes a new instance of the Watermarker class with the specified stream.
Watermarker(string) Initializes a new instance of the Watermarker class with the specified document path.
Watermarker(Stream, LoadOptions) Initializes a new instance of the Watermarker class with the specified stream and load options.
Watermarker(Stream, WatermarkerSettings) Initializes a new instance of the Watermarker class with the specified stream and settings.
Watermarker(string, LoadOptions) Initializes a new instance of the Watermarker class with the specified document path and load options.
Watermarker(string, WatermarkerSettings) Initializes a new instance of the Watermarker class with the specified document path and settings.
Watermarker(Stream, LoadOptions, WatermarkerSettings) Initializes a new instance of the Watermarker class with the specified stream, load options and settings.
Watermarker(string, LoadOptions, WatermarkerSettings) Initializes a new instance of the Watermarker class with the specified document path, load options and settings.

Properties

Name Description
SearchableObjects { get; set; } Gets or sets the content objects that are to be included in a watermark search.

Methods

Name Description
Add(Watermark) Adds a watermark to the loaded document.
Add(Watermark, WatermarkOptions) Adds a watermark to the loaded document using watermark options.
Dispose() Disposes the current instance.
GeneratePreview(PreviewOptions) Generates preview images for the document.
GetContent<T>() Returns the Content object for the loaded document.
GetDocumentInfo() Gets the information about the format of the loaded document.
GetImages() Finds all images in the document.
GetImages(ImageSearchCriteria) Finds images according to specified search criteria.
Remove(PossibleWatermark) Removes watermark from the document.
Remove(PossibleWatermarkCollection) Removes all watermarks in the collection from the document.
Save() Saves the document data to the underlying stream.
Save(SaveOptions) Saves the document data to the underlying stream using save options.
Save(Stream) Saves the document to the specified stream.
Save(string) Saves the document to the specified file location.
Save(Stream, SaveOptions) Saves the document to the specified stream using save options.
Save(string, SaveOptions) Saves the document to the specified file location using save options.
Search() Searches all possible watermarks in the document.
Search(SearchCriteria) Searches possible watermarks according to specified search criteria.

Examples

Load and save a content of any supported format.

// Load a content from a file.
using (Watermarker watermarker = new Watermarker("D:\\input.pdf"))
{
    // Use methods of Watermarker class to add, search or remove watermarks.

    // Save changes.
    watermarker.Save("D:\\output.pdf");
}

See Also