Load from local disc Groupdocs.redaction.Redactor class is a main class in Redaction API, providing functionality to open a document. When document is located on the local disk, you can pass its path to *Redactor *class constructor.
The following example demonstrates how to open a document from local disc:
final Redactor redactor = new Redactor("sample.docx"); try { // Here we can use document instance to perform redactions redactor.apply(new DeleteAnnotationRedaction()); redactor.save(); } finally { redactor....Merger Product Solution GroupDocs.Redaction Product Solution GroupDocs...GroupDocs Documentation / GroupDocs.Redaction Product Family / GroupDocs...
This article shows that how C# developers can apply metadata, image, annotation and text redaction in their documents. Wide range of document formats is supported, such as, PDF, DOC, DOCX, PPT, PPTX, XLS, XLSX and others....Merger Product Solution GroupDocs.Redaction Product Solution GroupDocs...GroupDocs Documentation / GroupDocs.Redaction Product Family / GroupDocs...
Load from Stream As an alternative to a local file, Redactor can open a document from stream.
The following example demonstrates how to load and redact a document using Stream:
final FileInputStream stream = new FileInputStream("sample.docx"); try { final Redactor redactor = new Redactor(stream); try { // Here we can use document instance to make redactions redactor.apply(new DeleteAnnotationRedaction()); redactor.save(); } finally { redactor.close(); } } finally { stream.close(); }...Merger Product Solution GroupDocs.Redaction Product Solution GroupDocs...GroupDocs Documentation / GroupDocs.Redaction Product Family / GroupDocs...
This article explains the method which can be used when for some reason files have non-standard extensions or if its format is supported, but not pre-configured....Merger Product Solution GroupDocs.Redaction Product Solution GroupDocs...GroupDocs Documentation / GroupDocs.Redaction Product Family / GroupDocs...
The simplest way to save the document is it provide no parameters to Save method. In this case the document will be rasterized to PDF and will have the same name as the original one except its extension (.PDF). The PDF file will be overwritten.
The following example demonstrates usage of Save() method with default options.
final Redactor redactor = new Redactor("sample.docx"); try { // Here we can use document instance to perform redactions redactor....Merger Product Solution GroupDocs.Redaction Product Solution GroupDocs...GroupDocs Documentation / GroupDocs.Redaction Product Family / GroupDocs...
This article demonstrates that how to save the document as a rasterized PDF file...Merger Product Solution GroupDocs.Redaction Product Solution GroupDocs...GroupDocs Documentation / GroupDocs.Redaction Product Family / GroupDocs...
Load password-protected file In order to open password-protected documents, you have to pass your password to LoadOptions class constructor or assign it to its Password property of an instance of LoadOptions class:
LoadOptions loadOptions = new LoadOptions("mypassword"); final Redactor redactor = new Redactor("protected_sample.docx", loadOptions); try { // Here we can use document instance to perform redactions redactor.apply(new ExactPhraseRedaction("John Doe", new ReplacementOptions("[personal]"))); redactor.save(); } finally { redactor.close(); }...Merger Product Solution GroupDocs.Redaction Product Solution GroupDocs...GroupDocs Documentation / GroupDocs.Redaction Product Family / GroupDocs...
This article demonstrates that how you can specify starting page index (zero based) and the number of pages from this index to save a rasterized PDF...Merger Product Solution GroupDocs.Redaction Product Solution GroupDocs...GroupDocs Documentation / GroupDocs.Redaction Product Family / GroupDocs...