PdfFileSanitization

Inheritance: java.lang.Object, com.aspose.pdf.facades.Facade com.aspose.pdf.facades.SaveableFacade com.aspose.pdf.facades.PdfFileSanitization, com.aspose.pdf.facades.Facade, com.aspose.pdf.facades.SaveableFacade com.aspose.pdf.facades.PdfFileSanitization, com.aspose.pdf.facades.SaveableFacade, com.aspose.pdf.facades.PdfFileSanitization

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

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.

Constructors

ConstructorDescription
PdfFileSanitizationInitializes a new instance.

Methods

MethodDescription
bindPdfInitializes the facade.
bindPdfBinds a Pdf stream for Sanitize.
bindPdfBinds a Pdf file for Sanitize.
closeCloses the facade.
getLogAfter file has Saved you can check what was done with file.
getUseRebuildXrefAndTrailerAllows to generate new xref and trailer for document.
getUseTrimBottomAllows to remove data after pdf data
getUseTrimTopAllows to remove data before pdf data.
rebuildXrefAndTrailerRemoves old xref with trailer and creates a new xref with trailer.
recoverRecovers document. Use properties to customize.
saveSaves the result PDF to stream.
saveSaves the result PDF to file.
setUseRebuildXrefAndTrailerAllows to generate new xref and trailer for document.
setUseTrimBottomAllows to remove data after pdf data
setUseTrimTopAllows to remove data before pdf data.
trimBottomRemoves data after last %%EOF.
trimTopRemoves data before %PDF.

PdfFileSanitization

public PdfFileSanitization()

Initializes a new instance.

bindPdf

Initializes the facade.

bindPdf

Binds a Pdf stream for Sanitize.

bindPdf

Binds a Pdf file for Sanitize.

close

public void close()

Closes the facade.

getLog

public final List < String > getLog()

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

Returns: list of String elements

getUseRebuildXrefAndTrailer

public final boolean getUseRebuildXrefAndTrailer()

Allows to generate new xref and trailer for document.

Returns: boolean value

getUseTrimBottom

public final boolean getUseTrimBottom()

Allows to remove data after pdf data

Returns: boolean value

getUseTrimTop

public final boolean getUseTrimTop()

Allows to remove data before pdf data.

Returns: boolean value

rebuildXrefAndTrailer

public final void rebuildXrefAndTrailer()

Removes old xref with trailer and creates a new xref with trailer.

recover

public final void recover()

Recovers document. Use properties to customize.

save

Saves the result PDF to stream.

save

Saves the result PDF to file.

setUseRebuildXrefAndTrailer

public final void setUseRebuildXrefAndTrailer(boolean value)

Allows to generate new xref and trailer for document.

Parameters:

ParameterTypeDescription
valueboolean value

setUseTrimBottom

public final void setUseTrimBottom(boolean value)

Allows to remove data after pdf data

Parameters:

ParameterTypeDescription
valueboolean value

setUseTrimTop

public final void setUseTrimTop(boolean value)

Allows to remove data before pdf data.

Parameters:

ParameterTypeDescription
valueboolean value

trimBottom

public final void trimBottom()

Removes data after last %%EOF.

trimTop

public final void trimTop()

Removes data before %PDF.