Foxit PDF SDK
FSRedaction Class Reference
Inheritance diagram for FSRedaction:
FSBase

Instance Methods

(BOOL) - apply
 Apply redaction in marked areas: remove the text or graphics under marked areas permanently.
More...
 
(id) - initWithDocument:
 Constructor, from a PDF document object.
More...
 
(id) - initWithOther:
 Constructor, with another redaction object.
More...
 
(BOOL) - isEmpty
 Check whether current object is empty or not.
More...
 
(FSRedact *) - markRedactAnnot:rects:
 Mark page contents (text object, image object, and path object) which are to be redacted.
More...
 
(FSProgressive *) - startApply:
 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
FSRedact

Method Documentation

◆ apply()

- (BOOL) apply

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 FSRedact::applyFillColor.

Returns
YES means success, while NO means failure.

◆ initWithDocument:()

- (id) initWithDocument: (FSPDFDoc*)  document

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 FSLibrary::initialize:key:, that means user has no right in using redaction related functions and this constructor will throw exception FSErrNoRedactionModuleRight.

◆ initWithOther:()

- (id) initWithOther: (FSRedaction*)  other

Constructor, with another redaction object.

Parameters
[in]otherAnother redaction object.

◆ isEmpty()

- (BOOL) isEmpty

Check whether current object is empty or not.

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

Returns
YES means current object is empty, while NO means not.

◆ markRedactAnnot:rects:()

- (FSRedact *) markRedactAnnot: (FSPDFPage*)  page
rects: (FSRectFArray*)  rects 

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:

  • Normal appearance, which is used when the marked area is not interacting with the user. The border color (also known as stroke color) can be set by FSAnnot::borderColor. The fill color can be set by FSRedact::fillColor. The opcacity can be set by FSMarkup::opacity.
  • Rollover appearance, which is used when the user moves the cursor into the marked area without pressing the mouse button. The border color and fill color are the same and can be set by FSRedact::applyFillColor.

Once function FSRedaction::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:()

- (FSProgressive *) startApply: (id<FSPauseCallback>)  pause

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

This function is similar to function FSRedaction::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 nil which means not to pause during the applying process. If this is not nil, it should be a valid pause object implemented by user.
Returns
A progressive object. Please check the rate of current progress by function FSProgressive::getRateOfProgress. If the rate is not 100 yet, call function FSProgressive::resume to continue the progress until the progress is finished.