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 and Description |
---|
PdfFileSanitization()
Initializes a new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
bindPdf(Document srcDoc)
Initializes the facade.
|
void |
bindPdf(InputStream inputStream)
Binds a Pdf stream for Sanitize.
|
void |
bindPdf(String inputFile)
Binds a Pdf file for Sanitize.
|
void |
close()
Closes the facade.
|
List<String> |
getLog()
After file has Saved you can check what was done with file.
|
boolean |
getUseTrimBottom()
Allows to remove data after pdf data
|
boolean |
getUseTrimTop()
Allows to remove data before pdf data.
|
void |
recover()
Recovers document.
|
void |
save(OutputStream outputStream)
Saves the result PDF to stream.
|
void |
save(String outputFile)
Saves the result PDF to file.
|
void |
setUseTrimBottom(boolean value)
Allows to remove data after pdf data
|
void |
setUseTrimTop(boolean value)
Allows to remove data before pdf data.
|
void |
trimBottom()
Removes data after last %%EOF.
|
void |
trimTop()
Removes data before %PDF.
|
bindPdf, bindPdf, bindPdf, dispose, getDocument
public final List<String> getLog()
After file has Saved you can check what was done with file.
getLog
in interface com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery
public final boolean getUseTrimTop()
Allows to remove data before pdf data.
public final void setUseTrimTop(boolean value)
Allows to remove data before pdf data.
value
- boolean valuepublic final boolean getUseTrimBottom()
Allows to remove data after pdf data
public final void setUseTrimBottom(boolean value)
Allows to remove data after pdf data
value
- boolean valuepublic void save(String outputFile)
Saves the result PDF to file.
save
in interface ISaveableFacade
save
in class SaveableFacade
outputFile
- output pdf filepublic void save(OutputStream outputStream)
Saves the result PDF to stream.
save
in interface ISaveableFacade
save
in class SaveableFacade
outputStream
- output pdf streampublic void bindPdf(String inputFile)
Binds a Pdf file for Sanitize.
public void bindPdf(InputStream inputStream)
Binds a Pdf stream for Sanitize.
public void bindPdf(Document srcDoc)
Initializes the facade.
srcDoc
- The Document object.public final void recover()
Recovers document. Use properties to customize.
recover
in interface com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery
public final void trimTop()
Removes data before %PDF.
trimTop
in interface com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery
public final void trimBottom()
Removes data after last %%EOF.
trimBottom
in interface com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery