Foxit PDF SDK
com.foxit.sdk.addon.Redaction Class Reference
Inheritance diagram for com.foxit.sdk.addon.Redaction:
com.foxit.sdk.common.Base

Public Member Functions

 Redaction (PDFDoc document) throws com.foxit.sdk.PDFException
 Constructor, from a PDF document object.
More...
 
 Redaction (Redaction other)
 Constructor, with another redaction object.
More...
 
boolean apply () throws com.foxit.sdk.PDFException
 Apply redaction in marked areas: remove the text or graphics under marked areas permanently.
More...
 
synchronized void delete ()
 Clean up related resources immediately. More...
 
boolean isEmpty ()
 Check whether current object is empty or not.
More...
 
Redact markRedactAnnot (PDFPage page, RectFArray rects) throws com.foxit.sdk.PDFException
 Mark page contents (text object, image object, and path object) which are to be redacted.
More...
 
Progressive startApply (PauseCallback pause) throws com.foxit.sdk.PDFException
 Start to apply redaction in marked areas: remove the text or graphics under marked areas permanently.
More...
 

Detailed Description

Redacting a PDF file allows user to hide sensitive information while keeping the document's formatting. This class can be used to mark page contents with redact annotations and apply redaction to permanently remove (redact) visible text and images from PDF documents to protect confidential information such as social security numbers.

See also
com.foxit.sdk.pdf.annots.Redact

Constructor & Destructor Documentation

◆ Redaction() [1/2]

com.foxit.sdk.addon.Redaction.Redaction ( PDFDoc  document) throws com.foxit.sdk.PDFException

Constructor, from a PDF document object.

Parameters
[in]documentA valid PDF document object.
Note
If module "Redaction" is not defined in the license information which is used in function common.Library.initialize , that means user has no right in using redaction related functions and this constructor will throw exception com.foxit.sdk.common.Constants.e_ErrNoRedactionModuleRight .

◆ Redaction() [2/2]

com.foxit.sdk.addon.Redaction.Redaction ( Redaction  other)

Constructor, with another redaction object.

Parameters
[in]otherAnother redaction object.

Member Function Documentation

◆ apply()

boolean com.foxit.sdk.addon.Redaction.apply ( ) throws com.foxit.sdk.PDFException

Apply redaction in marked areas: remove the text or graphics under marked areas permanently.

Once this functions is called, all the marked page content(text object, image object, and path object) in the document will be removed permanently. All the redact annotations which specify marked areas will be removed (with their pop-up annotations) and these marked areas will be filled by the color specified by pdf.annots.Redact.setApplyFillColor .

Returns
true means success, while false means failure.

◆ delete()

synchronized void com.foxit.sdk.addon.Redaction.delete ( )

Clean up related resources immediately.

Returns
None.
Note
Once this function is called, current object cannot be used anymore.

Reimplemented from com.foxit.sdk.common.Base.

◆ isEmpty()

boolean com.foxit.sdk.addon.Redaction.isEmpty ( )

Check whether current object is empty or not.

When the current object is empty, that means current object is useless.

Returns
true means current object is empty, while false means not.

◆ markRedactAnnot()

Redact com.foxit.sdk.addon.Redaction.markRedactAnnot ( PDFPage  page,
RectFArray  rects 
) throws com.foxit.sdk.PDFException

Mark page contents (text object, image object, and path object) which are to be redacted.

This function is to add special marks (called redact annotation) to the specified rectangles areas, in order to redact page contents in these areas. Usually, the marked area has two appearance:

Once function Redaction.apply is called, all the page contents under these marked area will be removed permanently and these marked areas will keep their rollover appearance all the time.

Parameters
[in]pageA PDF page whose content will be marked.
[in]rectsSpecify areas in the page to be marked. It should not be an empty array. All the input rectangles will be treated as one redact annotation.
Returns
A redact annotation object (along with a pop-up annotation by default), with default appearance:
apply fill color = black, border color = red, opacity = 1.0.

◆ startApply()

Progressive com.foxit.sdk.addon.Redaction.startApply ( PauseCallback  pause) throws com.foxit.sdk.PDFException

Start to apply redaction in marked areas: remove the text or graphics under marked areas permanently.

This function is similar to function Redaction.apply , but this function will return a progressive object which can be used to do the redaction progressively.

Parameters
[in]pauseA callback object which decides if the applying process should be paused. This can be null which means not to pause during the applying process. If this is not null, it should be a valid pause object implemented by user.
Returns
A progressive object. Please check the rate of current progress by function common.Progressive.getRateOfProgress . If the rate is not 100 yet, call function common.Progressive.resume to continue the progress until the progress is finished.