PdfFileSanitization
Inheritance: java.lang.Object, com.aspose.pdf.facades.IVentureLicenseTarget, com.aspose.pdf.facades.Facade, com.aspose.pdf.facades.SaveableFacade
All Implemented Interfaces: com.aspose.pdf.engine.security.impl.signatures.sanitization.IRecovery
public final class PdfFileSanitization extends SaveableFacade implements 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 |
---|---|
getLog() | After file has Saved you can check what was done with file. |
getUseTrimTop() | Allows to remove data before pdf data. |
setUseTrimTop(boolean value) | Allows to remove data before pdf data. |
getUseTrimBottom() | Allows to remove data after pdf data |
setUseTrimBottom(boolean value) | Allows to remove data after pdf data |
getUseRebuildXrefAndTrailer() | Allows to generate new xref and trailer for document. |
setUseRebuildXrefAndTrailer(boolean value) | Allows to generate new xref and trailer for document. |
save(String outputFile) | Saves the result PDF to file. |
save(OutputStream outputStream) | Saves the result PDF to stream. |
bindPdf(String inputFile) | Binds a Pdf file for Sanitize. |
bindPdf(InputStream inputStream) | Binds a Pdf stream for Sanitize. |
bindPdf(Document srcDoc) | Initializes the facade. |
recover() | Recovers document. |
trimTop() | Removes data before %PDF. |
trimBottom() | Removes data after last %%EOF. |
rebuildXrefAndTrailer() | Removes old xref with trailer and creates a new xref with trailer. |
close() | Closes the facade. |
PdfFileSanitization()
public PdfFileSanitization()
Initializes a new instance.
getLog()
public final List<String> getLog()
After file has Saved you can check what was done with file.
Returns: java.util.List<java.lang.String> - list of String elements
getUseTrimTop()
public final boolean getUseTrimTop()
Allows to remove data before pdf data.
Returns: boolean - boolean value
setUseTrimTop(boolean value)
public final void setUseTrimTop(boolean value)
Allows to remove data before pdf data.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean value |
getUseTrimBottom()
public final boolean getUseTrimBottom()
Allows to remove data after pdf data
Returns: boolean - boolean value
setUseTrimBottom(boolean value)
public final void setUseTrimBottom(boolean value)
Allows to remove data after pdf data
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean value |
getUseRebuildXrefAndTrailer()
public final boolean getUseRebuildXrefAndTrailer()
Allows to generate new xref and trailer for document.
Returns: boolean - boolean value
setUseRebuildXrefAndTrailer(boolean value)
public final void setUseRebuildXrefAndTrailer(boolean value)
Allows to generate new xref and trailer for document.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | boolean value |
save(String outputFile)
public void save(String outputFile)
Saves the result PDF to file.
Parameters:
Parameter | Type | Description |
---|---|---|
outputFile | java.lang.String | output pdf file |
save(OutputStream outputStream)
public void save(OutputStream outputStream)
Saves the result PDF to stream.
Parameters:
Parameter | Type | Description |
---|---|---|
outputStream | java.io.OutputStream | output pdf stream |
bindPdf(String inputFile)
public void bindPdf(String inputFile)
Binds a Pdf file for Sanitize.
Parameters:
Parameter | Type | Description |
---|---|---|
inputFile | java.lang.String | The pdf file to be edited. |
bindPdf(InputStream inputStream)
public void bindPdf(InputStream inputStream)
Binds a Pdf stream for Sanitize.
Parameters:
Parameter | Type | Description |
---|---|---|
inputStream | java.io.InputStream | The pdf stream to be edited. |
bindPdf(Document srcDoc)
public void bindPdf(Document srcDoc)
Initializes the facade.
Parameters:
Parameter | Type | Description |
---|---|---|
srcDoc | Document | The Document object. |
recover()
public final void recover()
Recovers document. Use properties to customize.
trimTop()
public final void trimTop()
Removes data before %PDF.
trimBottom()
public final void trimBottom()
Removes data after last %%EOF.
rebuildXrefAndTrailer()
public final void rebuildXrefAndTrailer()
Removes old xref with trailer and creates a new xref with trailer.
close()
public void close()
Closes the facade.