Foxit PDF SDK
fsdk.Redact Class Reference

Public Member Functions

def Apply ()
 Apply current redact annotation: remove the text, graphics and annotations under annotation rectangle permanently. More...
 
def EnableAutoFontSize ()
 Enable auto font size for the overlay text. More...
 
def EnableRepeatOverlayText (is_to_repeat_overlay_text)
 Set the flag to decide whether to repeat the overlay text. More...
 
def GetApplyFillColor ()
 Get the filling color which is used for rollover appearance and will be used after redaction is applied. More...
 
def GetDefaultAppearance ()
 Get default appearance data. More...
 
def GetFillColor ()
 Get fill color. More...
 
def GetOverlayText ()
 Get the overlay text. More...
 
def GetOverlayTextAlignment ()
 Get alignment value of overlay text. More...
 
def GetQuadPoints ()
 Get quadrilaterals. More...
 
def IsOverlayTextRepeated ()
 Check whether the overlay text is repeated or not. More...
 
def SetApplyFillColor (fill_color)
 Set the filling color which is used for rollover appearance and will be used after redaction is applied. More...
 
def SetDefaultAppearance (default_ap)
 Set default appearance data. More...
 
def SetFillColor (fill_color)
 Set fill color. More...
 
def SetOverlayText (overlay_text)
 Set the overlay text. More...
 
def SetOverlayTextAlignment (alignment)
 Set alignment value of overlay text. More...
 
def SetQuadPoints (quad_points_array)
 Set quadrilaterals. More...
 

Detailed Description

Class Redact represents a Foxit custom annotation type (not a standard annotation type). This kind of annotation is used to mark some content of a PDF page and these content will be removed once the redact annotations are applied. An existed redact annotation can be retrieved from PDF page by functions fsdk.PDFPage.GetAnnot and fsdk.PDFPage.GetAnnotAtPoint . A new redact annotation would be returned by function fsdk.Redaction.MarkRedactAnnot , instead of fsdk.PDFPage.AddAnnot .
Class fsdk.Redact is derived from class Markup and also offers functions to get/set markup annotation's basic properties of a redact annotation. Currently, fsdk.Annot.SetBorderInfo can be used for a redact annotation, but will not have any effect on the appearance of redact annotation. Besides, redact annotation cannot be moved by function fsdk.Annot.Move .

See also
fsdk.Redaction
fsdk.PDFPage
Markup

Member Function Documentation

◆ Apply()

def fsdk.Redact.Apply ( )

Apply current redact annotation: remove the text, graphics and annotations under annotation rectangle permanently.

Once this functions is called successfully, all page content(text object, image object, and path object) and annotations within area of current redact annotation rectangle will be removed permanently. However, if other redaction annotations intersect with or are contained within the current redaction, they will not be deleted. For current redact annotation, it also will be removed (with its pop-up annotation if any) as well - that means current annotation object will be useless when this function succeeds. Area of current redact annotation rectangle will be filled by the color specified by function fsdk.Redact.SetApplyFillColor .

Returns
true means success, while false means failure.

◆ EnableAutoFontSize()

def fsdk.Redact.EnableAutoFontSize ( )

Enable auto font size for the overlay text.

Returns
None.

◆ EnableRepeatOverlayText()

def fsdk.Redact.EnableRepeatOverlayText (   is_to_repeat_overlay_text)

Set the flag to decide whether to repeat the overlay text.

Parameters
[in]is_to_repeat_overlay_texttrue means to repeat the overlay text, while false means not. Default value: false.
Returns
None.

◆ GetApplyFillColor()

def fsdk.Redact.GetApplyFillColor ( )

Get the filling color which is used for rollover appearance and will be used after redaction is applied.

Returns
The fill color. Format: 0xRRGGBB. If no fill color can be found, 0xFFFFFF will be returned.

◆ GetDefaultAppearance()

def fsdk.Redact.GetDefaultAppearance ( )

Get default appearance data.

This property has effect on redact annotation's appearance. Default appearance data can be used in formatting text.

Returns
The default appearance data.

◆ GetFillColor()

def fsdk.Redact.GetFillColor ( )

Get fill color.

Returns
The fill color. Format: 0xRRGGBB. If no fill color can be found, 0x000000 will be returned.

◆ GetOverlayText()

def fsdk.Redact.GetOverlayText ( )

Get the overlay text.

Returns
The overlay text string.

◆ GetOverlayTextAlignment()

def fsdk.Redact.GetOverlayTextAlignment ( )

Get alignment value of overlay text.

This property has effect on the overlay text of redact annotation's appearance.

Returns
The alignment value. Please refer to values starting from fsdk.E_AlignmentLeft and this would be one of these values.

◆ GetQuadPoints()

def fsdk.Redact.GetQuadPoints ( )

Get quadrilaterals.

The order of points in a quadrilateral should be:

  • The first point is the point in left-top corner of the quadrilateral.

  • The second point is the point in right-top corner of the quadrilateral.

  • The third point is the point in left-bottom corner of the quadrilateral.

  • The fourth point is the point in right-bottom corner of the quadrilateral.

Returns
A quadrilateral points array that receives the quadrilaterals value.

◆ IsOverlayTextRepeated()

def fsdk.Redact.IsOverlayTextRepeated ( )

Check whether the overlay text is repeated or not.

Returns
true means that the overlay text is repeated, while false means not.

◆ SetApplyFillColor()

def fsdk.Redact.SetApplyFillColor (   fill_color)

Set the filling color which is used for rollover appearance and will be used after redaction is applied.

Parameters
[in]fill_colorNew fill color to be set. Format: 0xRRGGBB.
Returns
None.

◆ SetDefaultAppearance()

def fsdk.Redact.SetDefaultAppearance (   default_ap)

Set default appearance data.

This property has effect on redact annotation's appearance. Default appearance data can be used in formatting text.
If user wants the new default appearance data has effect on annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after setting new default appearance data.

Parameters
[in]default_apThe new default appearance data to be set. flags of input data can be used to decide which information is/are to be updated with the new data; for those no updated data, they will keep to use old data.
Returns
true means success, while false means failure. Specially, this function will return false if the parameter default_ap contains any incorrect value, for example:

◆ SetFillColor()

def fsdk.Redact.SetFillColor (   fill_color)

Set fill color.

Parameters
[in]fill_colorNew fill color to be set. Format: 0xRRGGBB.
Returns
None.

◆ SetOverlayText()

def fsdk.Redact.SetOverlayText (   overlay_text)

Set the overlay text.

Parameters
[in]overlay_textThe overlay text string to be set.
Returns
None.

◆ SetOverlayTextAlignment()

def fsdk.Redact.SetOverlayTextAlignment (   alignment)

Set alignment value of overlay text.

This property has effect on the overlay text of redact annotation's appearance. If user wants the new alignment has effect on the overlay text of annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after setting new alignment.

Parameters
[in]alignmentThe new alignment value. Please refer to values starting from fsdk.E_AlignmentLeft and this should be one of these values.
Returns
None.

◆ SetQuadPoints()

def fsdk.Redact.SetQuadPoints (   quad_points_array)

Set quadrilaterals.

This property has effect on the redact annotation's appearance.The order of points in a quadrilateral should be :

  • The first point is the point in left-top corner of the quadrilateral.

  • The second point is the point in right-top corner of the quadrilateral.

  • The third point is the point in left-bottom corner of the quadrilateral.

  • The fourth point is the point in right-bottom corner of the quadrilateral.

If user wants the new quadrilaterals has effect on annotation's appearance, please call function fsdk.Annot.ResetAppearanceStream after setting quadrilaterals.

Parameters
[in]quad_points_arrayA valid array of quadrilaterals. It should not be an empty array.
Returns
None.