Save
Contents
[
Hide
]
Save()
Saves the document to a file with the following options: AddSuffix = true, RasterizeToPDF = true.
public string Save()
Return Value
Path to redacted document
See Also
- class Redactor
- namespace GroupDocs.Redaction
- assembly GroupDocs.Redaction
Save(SaveOptions)
Saves the document to a file.
public string Save(SaveOptions saveOptions)
Parameter | Type | Description |
---|---|---|
saveOptions | SaveOptions | Options to add suffix or rasterize |
Return Value
Path to redacted document
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
- class SaveOptions
- class Redactor
- namespace GroupDocs.Redaction
- assembly GroupDocs.Redaction
Save(Stream, RasterizationOptions)
Saves the document to a stream, including custom location.
public void Save(Stream document, RasterizationOptions rasterizationOptions)
Parameter | Type | Description |
---|---|---|
document | Stream | Target stream |
rasterizationOptions | RasterizationOptions | Options to rasterize or not and to specify pages for rasterization |
Examples
The following example demonstrates how to set options for the rasterization process.
using (var redactor = new Redactor("SomePresentation.pptx"))
{
// redact sensitive data on the first slide
var rasterizationOptions = new RasterizationOptions();
rasterizationOptions.PageIndex = 0;
rasterizationOptions.PageCount = 1;
rasterizationOptions.Compliance = PdfComplianceLevel.PdfA1a;
using (var stream = File.Open(Path.Combine(@"C:\Temp", "PresentationFirstSlide.pdf")))
{
redactor.Save(stream, rasterizationOptions);
}
}
See Also
- class RasterizationOptions
- class Redactor
- namespace GroupDocs.Redaction
- assembly GroupDocs.Redaction