import { ObjectManager } from "../../ObjectManager"; import { MarkupAnnotation, type MarkupAnnotationProperties } from "./MarkupAnnotation"; import { type Quadrilateral, type Rect, type Color } from "../../Types"; import type { DefaultAppearance, DefaultAppearanceProperties } from "./DefaultAppearance"; import { VariableTextJustification } from "../../Enums"; /** * Defines properties of a redact annotation used to mark areas containing * information that needs to be erased from the document. * Note that redact annotations must be explicitly applied * (with a call to the {@link PdfDocument#redact} method * or one of its overloads) to actually remove the information * marked for redaction from the document. * @see {@link RedactAnnotation} */ export type RedactAnnotationProperties = MarkupAnnotationProperties & { type: "redact"; /** * The list of {@link Quadrilateral} structures defining the annotation area. * The coordinates of the quadrilaterals' points are relative to the upper left corner of the page's * media box, with the Y (vertical) coordinates increasing from top to bottom. * * Note that if the annotation is associated with more than one page, * the media box of the first of those pages is used to calculate the coordinates. * * If not empty, these quadrilaterals denote the content region that is intended to be redacted. * If this list is empty, the {@link AnnotationBase#rect} entry denotes the content region that is intended to be redacted. */ area?: Quadrilateral[]; /** * The overlay fill color with which to fill the redacted region after the affected * content has been removed. */ overlayFillColor?: Color; /** * The overlay text that should be drawn over the redacted region * after the affected content has been removed. */ overlayText?: string; /** * The overlay text that should be drawn over the redacted region * after the affected content has been removed. */ overlayTextRepeat?: boolean; /** * The appearance that specifies * the visual properties (font, font size etc.) used to format the overlay text. * The apperance can be specified as {@link DefaultAppearanceProperties} with set of properties like font, fontSize, foreColor or * as a string as it will be stored in a PDF stream: "/DF0 10 Tf 0 0 0 rg". */ overlayAppearance?: DefaultAppearanceProperties | string; /** * The justification to be used in displaying the overlay text. * See PDF specification for details. */ justification?: VariableTextJustification; /** * The outline color used to highlight the annotation rectangle. */ markBorderColor?: Color; /** * The color used to fill the annotation rectangle. */ markFillColor?: Color; }; /** * Represents a redact annotation used to mark areas containing * information that needs to be erased from the document. * Note that redact annotations must be explicitly applied * (with a call to the {@link PdfDocument#redact} method * or one of its overloads) to actually remove the information * marked for redaction from the document. */ export declare class RedactAnnotation extends MarkupAnnotation { /** * Creates a new {@link RedactAnnotation}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link RedactAnnotation}. */ constructor(om: ObjectManager); /** * Creates a new {@link RedactAnnotation}. */ constructor(); /** * Gets or sets the list of {@link Quadrilateral} structures defining the annotation area. * The coordinates of the quadrilaterals' points are relative to the upper left corner of the page's * media box, with the Y (vertical) coordinates increasing from top to bottom. * * Note that if the annotation is associated with more than one page, * the media box of the first of those pages is used to calculate the coordinates. * * If not empty, these quadrilaterals denote the content region that is intended to be redacted. * If this list is empty, the {@link AnnotationBase#rect} entry denotes the content region that is intended to be redacted. */ get area(): Quadrilateral[] | null; /** * Gets or sets the list of {@link Quadrilateral} structures defining the annotation area. * The coordinates of the quadrilaterals' points are relative to the upper left corner of the page's * media box, with the Y (vertical) coordinates increasing from top to bottom. * * Note that if the annotation is associated with more than one page, * the media box of the first of those pages is used to calculate the coordinates. * * If not empty, these quadrilaterals denote the content region that is intended to be redacted. * If this list is empty, the {@link AnnotationBase#rect} entry denotes the content region that is intended to be redacted. */ set area(value: (Quadrilateral | Rect)[] | null); /** * Gets or sets the list of {@link Quadrilateral} structures defining the annotation area. * The coordinates of the quadrilaterals' points are in PDF user space coordinates. * The positive X axis extends horizontally to the right, and the positive Y axis * extends vertically upward, with the origin usually in the lower left corner of the page. * * If not empty, these quadrilaterals denote the content region that is intended to be redacted. * If this list is empty, the {@link AnnotationBase#rect} entry denotes the content region that is intended to be redacted. */ get pdfArea(): Quadrilateral[] | null; /** * Gets or sets the list of {@link Quadrilateral} structures defining the annotation area. * The coordinates of the quadrilaterals' points are in PDF user space coordinates. * The positive X axis extends horizontally to the right, and the positive Y axis * extends vertically upward, with the origin usually in the lower left corner of the page. * * If not empty, these quadrilaterals denote the content region that is intended to be redacted. * If this list is empty, the {@link AnnotationBase#rect} entry denotes the content region that is intended to be redacted. */ set pdfArea(value: (Quadrilateral | Rect)[] | null); /** * Gets or sets the overlay fill color with which to fill the redacted region after the affected * content has been removed. */ get overlayFillColor(): Color; /** * Gets or sets the overlay fill color with which to fill the redacted region after the affected * content has been removed. */ set overlayFillColor(value: Color); /** * Gets or sets the overlay text that should be drawn over the redacted region * after the affected content has been removed. */ get overlayText(): string | null; /** * Gets or sets the overlay text that should be drawn over the redacted region * after the affected content has been removed. */ set overlayText(value: string | null); /** * Gets or sets the overlay text that should be drawn over the redacted region * after the affected content has been removed. */ get overlayTextRepeat(): boolean; /** * Gets or sets the overlay text that should be drawn over the redacted region * after the affected content has been removed. */ set overlayTextRepeat(value: boolean); /** * Gets the {@link DefaultAppearance} object that specifies * the visual properties (font, font size etc.) used to format the overlay text. */ get overlayAppearance(): DefaultAppearance; /** * Gets or sets the justification to be used in displaying the overlay text. * See PDF specification for details. */ get justification(): VariableTextJustification; /** * Gets or sets the justification to be used in displaying the overlay text. * See PDF specification for details. */ set justification(value: VariableTextJustification); /** * Gets or sets the outline color used to highlight the annotation rectangle. */ get markBorderColor(): Color | null; /** * Gets or sets the outline color used to highlight the annotation rectangle. */ set markBorderColor(value: Color | null); /** * Gets or sets the color used to fill the annotation rectangle. */ get markFillColor(): Color | null; /** * Gets or sets the color used to fill the annotation rectangle. */ set markFillColor(value: Color | null); }