com.groupdocs.redaction

Class Document

    • Constructor Detail

      • Document

        public Document()
    • Method Detail

      • getDocumentPath

        public final String getDocumentPath()

        Document file path. Unavailable when the document was opened from stream

      • getFormatInstance

        public final DocumentFormatInstance getFormatInstance()

        An instance of document format connector, which was used to open the document

      • close

        public final void close()

        Disposes any resources, associated with the document

        Specified by:
        close in interface Closeable
        Specified by:
        close in interface AutoCloseable
      • redactWith

        public final RedactionSummary redactWith(Redaction redaction)

        Apply redaction to the document

        Parameters:
        redaction - An instance of Redaction to apply
        Returns:
        Success or failure and error message in this case
      • redactWith

        public final RedactionSummary redactWith(Redaction[] redactions)

        Apply a set of redactions to the document

        Parameters:
        redactions - An array of redactions to apply
        Returns:
        Success or failure and error message in this case
      • save

        public final String save()
                          throws Exception

        Save the document to a file with the following options: AddSuffix = true, RasterizeToPDF = true

        Returns:
        Path to redacted document
        Throws:
        Exception
      • save

        public final String save(SaveOptions options)
                          throws Exception

        Save the document to a file

        Parameters:
        options - Options to add suffix or rasterize
        Returns:
        Path to redacted document
        Throws:
        Exception
      • save

        public final void save(OutputStream output,
                SaveOptions options)
                        throws Exception

        Save the document to a stream, including custom location

        Parameters:
        output - Target stream
        options - SaveOptions.RasterizeToPDF true or false is the only option
        Throws:
        Exception