Document Class
Represents a document where a watermark can be placed.
Inheritance Hierarchy

Namespace: GroupDocs.Watermark
Assembly: GroupDocs.Watermark (in GroupDocs.Watermark.dll) Version: 19.5
Syntax
public abstract class Document : DocumentPart, 
	IDisposable

The Document type exposes the following members.

Properties
  NameDescription
Public propertyStatic memberCode exampleDefaultSearchableObjects
Gets or sets the document objects that are to be included in a watermark search by default. This setting should be configured before document instance creation. It has no effect on already existing instances. To configure searchable objects for a particular document instance, use SearchableObjects property.
Public propertyCode exampleSearchableObjects
Gets or sets the document objects that are to be included in a watermark search. Note, this property also specifies document objects which are used in image search. For more information see FindWatermarks, FindWatermarks(SearchCriteria), FindImages and FindImages(ImageSearchCriteria) methods.
Methods
  NameDescription
Public methodCode exampleAddWatermark
Adds a watermark to this DocumentPart.
(Inherited from DocumentPart.)
Public methodDispose
Disposes the current instance.
Protected methodDispose(Boolean)
Disposes the current instance.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodCode exampleFindImages
Finds all images in the document. The search is conducted in objects specified in SearchableObjects.
(Inherited from DocumentPart.)
Public methodFindImages(ImageSearchCriteria)
Finds images according to specified search criteria. The search is conducted in objects specified in SearchableObjects.
(Inherited from DocumentPart.)
Public methodFindWatermarks
Finds all possible watermarks in the document. The search is conducted in objects specified in SearchableObjects.
(Inherited from DocumentPart.)
Public methodCode exampleFindWatermarks(SearchCriteria)
Finds possible watermarks according to specified search criteria. The search is conducted in objects specified in SearchableObjects.
(Inherited from DocumentPart.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodStatic memberCode exampleGetInfo(Stream)
Gets the information about the format of a document stored in the stream.
Public methodStatic memberCode exampleGetInfo(String)
Gets the information about the format of a document stored in the file.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Public methodStatic memberLoad(Stream)
Loads a new document from the specified stream.
Public methodStatic memberLoad(String)
Loads a new document from the specified file.
Public methodStatic memberLoad(Stream, LoadOptions)
Loads a new document from the specified stream.
Public methodStatic memberLoad(String, LoadOptions)
Loads a new document from the specified file.
Public methodStatic memberLoadTDocument(Stream)
Loads a new document from the specified stream.
Public methodStatic memberLoadTDocument(String)
Loads a new document from the specified file.
Public methodStatic memberLoadTDocument(Stream, LoadOptions)
Loads a new document from the specified stream.
Public methodStatic memberLoadTDocument(String, LoadOptions)
Loads a new document from the specified file.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSave
Saves the document data to the underlying stream.
Public methodSave(Stream)
Saves the document to the specified stream.
Public methodSave(String)
Saves the document to the specified file location.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Examples
Load and save a document of any supported format.
C#
// Load a document from a file.
using (Document document = Document.Load("D:\\input.pdf"))
{
    // Use methods of Document class to add or remove watermarks.

    // Save changes.
    document.Save("D:\\output.pdf");
}
See Also
Inheritance Hierarchy