com.aspose.pdf.facades

Class PdfFileSanitization

  • All Implemented Interfaces:
    com.aspose.ms.System.IDisposable, com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery, IFacade, ISaveableFacade


    public final class PdfFileSanitization
    extends SaveableFacade
    implements com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery

    Represents sanitization and recovery API. Use it if you can't create/open documents in any other way.

    • Constructor Detail

      • PdfFileSanitization

        public PdfFileSanitization()

        Initializes a new instance.

    • Method Detail

      • getLog

        public final List<String> getLog()

        After file has Saved you can check what was done with file.

        Specified by:
        getLog in interface com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery
        Returns:
        list of String elements
      • getUseTrimTop

        public final boolean getUseTrimTop()

        Allows to remove data before pdf data.

        Returns:
        boolean value
      • setUseTrimTop

        public final void setUseTrimTop(boolean value)

        Allows to remove data before pdf data.

        Parameters:
        value - boolean value
      • getUseTrimBottom

        public final boolean getUseTrimBottom()

        Allows to remove data after pdf data

        Returns:
        boolean value
      • setUseTrimBottom

        public final void setUseTrimBottom(boolean value)

        Allows to remove data after pdf data

        Parameters:
        value - boolean value
      • bindPdf

        public void bindPdf(String inputFile)

        Binds a Pdf file for Sanitize.

        Specified by:
        bindPdf in interface IFacade
        Overrides:
        bindPdf in class Facade
        Parameters:
        inputFile - The pdf file to be edited.
      • bindPdf

        public void bindPdf(InputStream inputStream)

        Binds a Pdf stream for Sanitize.

        Specified by:
        bindPdf in interface IFacade
        Overrides:
        bindPdf in class Facade
        Parameters:
        inputStream - The pdf stream to be edited.
      • bindPdf

        public void bindPdf(Document srcDoc)

        Initializes the facade.

        Parameters:
        srcDoc - The Document object.
      • recover

        public final void recover()

        Recovers document. Use properties to customize.

        Specified by:
        recover in interface com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery
      • trimTop

        public final void trimTop()

        Removes data before %PDF.

        Specified by:
        trimTop in interface com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery
      • trimBottom

        public final void trimBottom()

        Removes data after last %%EOF.

        Specified by:
        trimBottom in interface com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery
      • close

        public void close()

        Closes the facade.

        Specified by:
        close in interface IFacade
        Overrides:
        close in class Facade