public class RedactionImpl extends java.lang.Object implements IRedaction
Constructor and Description |
---|
RedactionImpl() |
Modifier and Type | Method and Description |
---|---|
java.util.List<RedactionSuggestion> |
getRedactionSuggestions(java.lang.String ticket,
java.lang.String objectId,
long lastModified,
int numPages)
Returns a list of suggested redactions and their locations which have been detected in the document.
|
protected static java.util.List<RedactionSuggestion> |
getRedactionSuggestionsForDocument(org.apache.pdfbox.pdmodel.PDDocument document,
int numPages)
A helper method which creates new suggested redactions.
|
com.aspose.pdf.Document |
redactTermsFromDocument(java.lang.String ticket,
java.lang.String objectId,
java.util.List<java.lang.String> stringToRedact)
Helper that finds a string of text in a PDF and redacts instances of that text
|
java.util.List<java.lang.String> |
redactTermsFromFolder(java.lang.String ticket,
java.lang.String containerId,
java.util.List<java.lang.String> textsToRedact,
java.lang.String redactionMode,
java.lang.Boolean newVersion,
java.lang.Boolean majorVersion)
A method which will redact a certain term from every document in a given folder.
|
java.util.List<java.lang.String> |
redactTermsFromListOfIds(java.lang.String ticket,
java.util.List<java.lang.String> objectIds,
java.util.List<java.lang.String> stringsToRedact,
java.lang.String redactionMode,
java.lang.Boolean newVersion,
java.lang.Boolean majorVersion)
A method which will redact a list of terms from every objectID passed in
|
RedactionInfo |
saveRedactions(java.lang.String ticket,
java.lang.String objectId,
java.lang.String parentId,
java.lang.String redactionMode,
Redaction[] redactions,
java.lang.Boolean newVersion,
java.lang.Boolean majorVersion)
Saves the provided redactions, permanently modifying the provided document.
|
public RedactionInfo saveRedactions(java.lang.String ticket, java.lang.String objectId, java.lang.String parentId, java.lang.String redactionMode, Redaction[] redactions, java.lang.Boolean newVersion, java.lang.Boolean majorVersion)
saveRedactions
in interface IRedaction
ticket
- A valid OC ticket.objectId
- The objectId of the document to save redactions for.parentId
- The parentId of the document to save redactions for.redactionMode
- The mode under which, we're saving these redactions. Determines whether or not we keep an unredacted copy when saving redactions.redactions
- An array of redactions to save on the document.newVersion
- - true if the a new version of the document will be created when the document is redacted. if false, the document in the repository will remain the same version when redactedmajorVersion
- - true if the a major version of the document will be created when the document is redacted. if false, the document in the repository will default to a minor version when redactedpublic java.util.List<RedactionSuggestion> getRedactionSuggestions(java.lang.String ticket, java.lang.String objectId, long lastModified, int numPages)
IRedaction
getRedactionSuggestions
in interface IRedaction
ticket
- A valid OC ticket.objectId
- The objectId of the PDF object to create suggested redactions for.lastModified
- The timestamp this object was last modified (used for caching purposes).numPages
- number of pages in the documentpublic java.util.List<java.lang.String> redactTermsFromFolder(java.lang.String ticket, java.lang.String containerId, java.util.List<java.lang.String> textsToRedact, java.lang.String redactionMode, java.lang.Boolean newVersion, java.lang.Boolean majorVersion)
redactTermsFromFolder
in interface IRedaction
ticket
- - A valid OC ticket.containerId
- - The objectId of the folder that we will redact documents from.textsToRedact
- - The string that will be redacted from the PDF documents contained in the folderredactionMode
- The mode under which, we're saving these redactions. Determines whether or not we keep an unredacted copy when saving redactions.newVersion
- - true if the a new version of the document will be created when the document is redacted. if false, the document in the repository will remain the same version when redactedmajorVersion
- - true if the a major version of the document will be created when the document is redacted. if false, the document in the repository will default to a minor version when redactedpublic java.util.List<java.lang.String> redactTermsFromListOfIds(java.lang.String ticket, java.util.List<java.lang.String> objectIds, java.util.List<java.lang.String> stringsToRedact, java.lang.String redactionMode, java.lang.Boolean newVersion, java.lang.Boolean majorVersion)
IRedaction
redactTermsFromListOfIds
in interface IRedaction
ticket
- - A valid OC ticket.objectIds
- - The objectIds selected that we will redact documents from.stringsToRedact
- - The list of strings that will be redacted from the PDF documents contained in the folderredactionMode
- The mode under which, we're saving these redactions. Determines whether or not we keep an unredacted copy when saving redactions.newVersion
- - true if the a new version of the document will be created when the document is redacted. if false, the document in the repository will remain the same version when redactedmajorVersion
- - true if the a major version of the document will be created when the document is redacted. if false, the document in the repository will default to a minor version when redactedpublic com.aspose.pdf.Document redactTermsFromDocument(java.lang.String ticket, java.lang.String objectId, java.util.List<java.lang.String> stringToRedact)
redactTermsFromDocument
in interface IRedaction
ticket
- - a valid OC ticketobjectId
- - input stream of unredacted PDFstringToRedact
- - the list of strings that will be redacted from the PDF documentprotected static java.util.List<RedactionSuggestion> getRedactionSuggestionsForDocument(org.apache.pdfbox.pdmodel.PDDocument document, int numPages) throws java.io.IOException
document
- - The document which is scanned for possible redactions.numPages
- - The number of pages of the documentjava.io.IOException