SaveOptions

SaveOptions class

Provides options for changing an output file name and/or converting the document to image-based PDF (rasterization).

public class SaveOptions

Constructors

Name Description
SaveOptions() Initializes a new instance with defaults: rasterize to PDF - false, add suffix - false.
SaveOptions(bool, string) Initializes a new instance with given parameters.

Properties

Name Description
AddSuffix { get; set; } Gets or sets a value indicating whether the file name needs to be changed before saving. False by default.
Rasterization { get; } Gets the rasterization settings.
RasterizeToPDF { get; set; } Gets or sets a value indicating whether all pages in the document need to be converted to images and put in a single PDF file.
RedactedFileSuffix { get; set; } Gets or sets a custom suffix for output file name. If it is not specified, the SaveSuffix constant will be used.

Fields

Name Description
const SaveSuffix Represents default suffix value, which is “Redacted”.

Remarks

Learn more

Examples

The following example demonstrates how to save a document using SaveOptions.

    using (Redactor redactor = new Redactor(@"C:\sample.pdf"))
    {
       // Document redaction goes here
       // ...
    
       // Save the document with default options (convert pages into images, save as PDF)
       redactor.Save();
    
       // Save the document in original format overwriting original file
       redactor.Save(new SaveOptions() { AddSuffix = false, RasterizeToPDF = false });
    
       // Save the document to "*_Redacted.*" file in original format
       redactor.Save(new SaveOptions() { AddSuffix = true, RasterizeToPDF = false });
    
       // Save the document to "*_AnyText.*" (e.g. timestamp instead of "AnyText") in its file name without rasterization
       redactor.Save(new SaveOptions(false, "AnyText"));
    }    

See Also