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
| Constructor | Description |
|---|---|
| PdfFileSanitization | Initializes a new instance. |
Methods
| Method | Description |
|---|---|
| bindPdf | Initializes the facade. |
| bindPdf | Binds a Pdf stream for Sanitize. |
| bindPdf | Binds a Pdf file for Sanitize. |
| close | Closes the facade. |
| getLog | After file has Saved you can check what was done with file. |
| getUseRebuildXrefAndTrailer | Allows to generate new xref and trailer for document. |
| getUseTrimBottom | Allows to remove data after pdf data |
| getUseTrimTop | Allows to remove data before pdf data. |
| rebuildXrefAndTrailer | Removes old xref with trailer and creates a new xref with trailer. |
| recover | Recovers document. Use properties to customize. |
| save | Saves the result PDF to stream. |
| save | Saves the result PDF to file. |
| setUseRebuildXrefAndTrailer | Allows to generate new xref and trailer for document. |
| setUseTrimBottom | Allows to remove data after pdf data |
| setUseTrimTop | Allows to remove data before pdf data. |
| trimBottom | Removes data after last %%EOF. |
| trimTop | Removes 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:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value |
setUseTrimBottom
public final void setUseTrimBottom(boolean value)
Allows to remove data after pdf data
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value |
setUseTrimTop
public final void setUseTrimTop(boolean value)
Allows to remove data before pdf data.
Parameters:
| Parameter | Type | Description |
|---|---|---|
| value | boolean value |
trimBottom
public final void trimBottom()
Removes data after last %%EOF.
trimTop
public final void trimTop()
Removes data before %PDF.