How can I help you?
PdfRedactionAnnotation
6 Feb 202612 minutes to read
PdfRedactionAnnotation class represents the redaction annotation objects.
// Load an existing PDF document
let document: PdfDocument = new PdfDocument(data, password);
// Get the first page
let page: PdfPage = document.getPage(0) as PdfPage;
// Create a new redaction annotation
const annotation: PdfRedactionAnnotation = new PdfRedactionAnnotation({x: 50, y: 100, width: 100, height: 50});
// Add annotation to the page
page.annotations.add(annotation);
// Destroy the document
document.destroy();Properties
Get appearanceFillColor PdfColor
Gets the appearance fill color of the annotation.
Set appearanceFillColor void
Sets the appearance fill color of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfColor |
R, G, B color values in between 0 to 255. |
Get author string
Gets the author of the annotation.
Set author void
Sets the author of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | string |
Author. |
Get border PdfAnnotationBorder
Gets the border of the annotation.
Set border void
Sets the border of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfAnnotationBorder |
Border. |
Get borderColor PdfColor
Gets the border color of the annotation.
Set borderColor void
Sets the border color of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfColor |
R, G, B color values in between 0 to 255. |
Get bounds Rectangle
Gets the bounds of the annotation.
Set bounds void
Sets the bounds of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | Rectangle |
Bounds. |
Get boundsCollection Rectangle[]
Gets the bounds collection of the annotation.
Set boundsCollection void
Sets the bounds collection of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | Rectangle[] |
Bounds collection. |
Get caption PdfAnnotationCaption
Gets the caption of the annotation.
Set caption void
Sets the caption of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfAnnotationCaption |
Annottion caption. |
Get color PdfColor
Gets the fore color of the annotation.
Set color void
Sets the fore color of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfColor |
R, G, B color values in between 0 to 255. |
Get comments PdfPopupAnnotationCollection
Gets the comments of the PDF annotation (Read only).
Get creationDate Date
Gets the creation date of the annotation.
Set creationDate void
Sets the creation date of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | Date |
Creation date. |
Get flags PdfAnnotationFlag
Gets the flags of the annotation.
Set flags void
Sets the flags of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfAnnotationFlag |
Flag value. |
Get flatten boolean
Gets the boolean flag indicating whether the annotation have been flattened or not.
Set flatten void
Sets the boolean flag indicating whether the annotation have been flattened or not.
| Parameter | Type | Description |
|---|---|---|
| value | boolean |
Flatten. |
Get flattenPopups boolean
Gets the boolean flag indicating whether annotation’s popup have been flattened or not.
Set flattenPopups void
Sets the boolean flag indicating whether the annotation’s popup have been flattened or not.
| Parameter | Type | Description |
|---|---|---|
| value | boolean |
Flatten Popup. |
Get font PdfFont
Gets the font of the annotation.
Set font void
Sets the font of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfFont |
Font. |
Get innerColor PdfColor
Gets the inner color of the annotation.
Set innerColor void
Sets the inner color of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfColor |
R, G, B color values in between 0 to 255. |
Get layer PdfLayer
Gets the PdfLayer of the annotation.
Set layer void
Set the PdfLayer to the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfLayer |
PDF layer to the annotation. |
Get modifiedDate Date
Gets the modification date of the annotation.
Set modifiedDate void
Sets the modification date of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | Date |
Modified date. |
Get name string
Gets the name of the annotation.
Set name void
Sets the name of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | string |
Name. |
Get opacity number
Gets the opacity of the annotation.
Set opacity void
Sets the opacity of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | number |
Opacity in between 0 t0 1. |
Get overlayText string
Gets the overlay text of the annotation.
Set overlayText void
Sets the overlay text of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | string |
Overlay text. |
Get repeatText boolean
Gets the boolean flag indicating whether annotation has repeat text or not.
Set repeatText void
Sets the boolean flag indicating whether annotation has repeat text or not.
| Parameter | Type | Description |
|---|---|---|
| value | boolean |
Repeat text. |
Get reviewHistory PdfPopupAnnotationCollection
Gets the review history of the PDF annotation (Read only).
Get rotate number
Gets the rotation angle of the annotation (Read only).
Get rotationAngle PdfRotationAngle
Gets the rotation of the annotation.
Set rotationAngle void
Sets the rotation of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfRotationAngle |
Rotation angle. |
Get subject string
Gets the subject of the annotation.
Set subject void
Sets the subject of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | string |
Subject. |
Get text string
Gets the text of the annotation.
Set text void
Sets the text of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | string |
Text. |
Get textAlignment PdfTextAlignment
Gets the text alignment of the annotation.
Set textAlignment void
Sets the text alignment of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfTextAlignment |
Text alignment. |
Get textColor PdfColor
Gets the text color of the annotation.
Set textColor void
Sets the text color of the annotation.
| Parameter | Type | Description |
|---|---|---|
| value | PdfColor |
R, G, B color values in between 0 to 255. |
Methods
getValues
Gets the values associated with the specified key.
| Parameter | Type | Description |
|---|---|---|
| name | string |
Key. |
Returns string[]
setAppearance
Set the boolean flag to create a new appearance stream for annotations.
| Parameter | Type | Description |
|---|---|---|
| value | boolean |
Set appearance. |
Returns void
setValues
Sets the values associated with the specified key.
| Parameter | Type | Description |
|---|---|---|
| name | string |
Key. |
| value | string |
Value associated with the key.. |
Returns void