Save

Save()

Saves the document data to the underlying stream.

public WatermarkResult Save()

Remarks

Learn more about saving the documents Saving documents.

Examples

Remove particular text fragments from the email message body/subject and save the email message.

using (Watermarker watermarker = new Watermarker(@"D:\test.msg"))
{
    SearchCriteria criteria = new TextSearchCriteria("test", false);
    // Note, search is performed only if you pass TextSearchCriteria instance to Search method
    PossibleWatermarkCollection watermarks = watermarker.Search(criteria);
    // Remove found text fragments
    watermarker.Remove(watermarks);
    // Save changes
    watermarker.Save();
}

See Also


Save(string)

Saves the document to the specified file location.

public WatermarkResult Save(string filePath)
Parameter Type Description
filePath String The file path to save the document data to.

Remarks

Learn more about saving the documents Saving documents.

Examples

Add the watermark and save the document to another file.

using (Watermarker watermarker = new Watermarker("input.pdf"))
{                                                                                   
    TextWatermark watermark = new TextWatermark("top secret", new Font("Arial", 36));
    watermarker.Add(watermark);                                            
    watermarker.Save("ouput.pdf");                                   
}                                                                                   

See Also


Save(Stream)

Saves the document to the specified stream.

public WatermarkResult Save(Stream document)
Parameter Type Description
document Stream The stream to save the document data to.

Remarks

Learn more about saving the documents Saving documents.

Examples

Add watermark and save the document to the memory stream.

using (Watermarker watermarker = new Watermarker("input.pdf"))
{
    TextWatermark watermark = new TextWatermark("top secret", new Font("Arial", 36));
    watermarker.Add(watermark);
    using (MemoryStream stream = new MemoryStream())
    {
        watermarker.Save(stream);
        // ...
    }
}

See Also


Save(SaveOptions)

Saves the document data to the underlying stream using save options.

public WatermarkResult Save(SaveOptions options)
Parameter Type Description
options SaveOptions Additional options to use when saving a document.

Remarks

Learn more about saving the documents Saving documents.

Examples

Add watermark and save the document with default SaveOptions.

using (Watermarker watermarker = new Watermarker("input.pdf"))
{
    TextWatermark watermark = new TextWatermark("top secret", new Font("Arial", 36));
    watermarker.Add(watermark);
    watermarker.Save(new SaveOptions());
}

See Also


Save(string, SaveOptions)

Saves the document to the specified file location using save options.

public WatermarkResult Save(string filePath, SaveOptions options)
Parameter Type Description
filePath String The file path to save the document data to.
options SaveOptions Additional options to use when saving a document.

Remarks

Learn more about saving the documents Saving documents.

Examples

Add the watermark and save the document to another file with default SaveOptions.

using (Watermarker watermarker = new Watermarker("input.pdf"))
{                                                                                   
    TextWatermark watermark = new TextWatermark("top secret", new Font("Arial", 36));
    watermarker.Add(watermark);                                            
    watermarker.Save("ouput.pdf", new SaveOptions());
}                                                                                   

See Also


Save(Stream, SaveOptions)

Saves the document to the specified stream using save options.

public WatermarkResult Save(Stream document, SaveOptions options)
Parameter Type Description
document Stream The stream to save the document data to.
options SaveOptions Additional options to use when saving a document.

Remarks

Learn more about saving the documents Saving documents.

Examples

Add watermark and save the document to the memory stream with default SaveOptions.

using (Watermarker watermarker = new Watermarker("input.pdf"))
{
    TextWatermark watermark = new TextWatermark("top secret", new Font("Arial", 36));
    watermarker.Add(watermark);
    using (MemoryStream stream = new MemoryStream())
    {
        watermarker.Save(stream, new SaveOptions());
        // ...
    }
}

See Also