import { ObjectManager } from "../../ObjectManager"; import { MarkupAnnotation, type MarkupAnnotationProperties } from "./MarkupAnnotation"; import { type Point } from "../../Types"; import { LineEndingStyle } from "../../Enums"; import { type Color } from "../../Types"; import { LineAnnotationTextPosition } from "../../Enums"; /** * Defines properties of a line annotation, that displays a single straight line on a page. * When opened, it displays a pop-up window containing the text of the associated note. * @see {@link LineAnnotation} */ export type LineAnnotationProperties = MarkupAnnotationProperties & { type: "line"; /** * The start point of the line annotation. * The coordinates of the point are relative to the upper left corner of the page's * media box, with the Y (vertical) coordinates increasing from top to bottom. */ start: Point; /** * The end point of the line. * The coordinates of the point are relative to the upper left corner of the page's * media box, with the Y (vertical) coordinates increasing from top to bottom. */ end: Point; /** * The line width in points. */ lineWidth?: number; /** * The line dash pattern. Null means a solid line. */ lineDashPattern?: number[]; /** * The style of line start. */ lineStartStyle?: LineEndingStyle; /** * The style of line end. */ lineEndStyle?: LineEndingStyle; /** * The interior color with which to fill the annotation's line endings. */ lineEndingsFillColor?: Color; /** * The length of leader lines in default user space that extend from each endpoint of the line perpendicular to the line itself. * A positive value means that the leader lines appear in the direction that is clockwise when traversing * the line from its starting point to its ending point. * A negative value indicates the opposite direction. */ leaderLinesLength?: number; /** * A non-negative number representing the length of leader line extensions that extend * from the line proper 180 degrees from the leader lines. */ leaderLinesExtension?: number; /** * A non-negative number representing the length of the leader line offset, * which is the amount of empty space between the endpoints of the annotation and the beginning * of the leader lines. */ leaderLineOffset?: number; /** * The annotation's text positioning. */ textPosition?: LineAnnotationTextPosition; /** * The horizontal offset along the annotation line from its midpoint, * with a positive value indicating offset to the right and a negative value indicating offset to the left. */ horizontalTextOffset?: number; /** * The vertical offset perpendicular to the annotation line, with a positive value * indicating a shift up and a negative value indicating a shift down. */ verticalTextOffset?: number; }; /** * Represents a line annotation, that displays a single straight line on a page. * When opened, it displays a pop-up window containing the text of the associated note. */ export declare class LineAnnotation extends MarkupAnnotation { /** * Creates a new {@link LineAnnotation}. * * @param om - {@link ObjectManager} that controls the lifetime of the {@link LineAnnotation}. */ constructor(om: ObjectManager); /** * Creates a new {@link LineAnnotation}. */ constructor(); /** * Gets or sets the start point of the line annotation. * The coordinates of the point 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 rectangle's location. */ get start(): Point; /** * Gets or sets the start point of the line annotation. * The coordinates of the point 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 rectangle's location. */ set start(value: Point); /** * Gets or sets the start point of the line annotation 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. */ get pdfStart(): Point; /** * Gets or sets the start point of the line annotation 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. */ set pdfStart(value: Point); /** * Gets or sets the end point of the line. * The coordinates of the point 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 rectangle's location. */ get end(): Point; /** * Gets or sets the end point of the line. * The coordinates of the point 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 rectangle's location. */ set end(value: Point); /** * Gets or sets the end point of the line annotation in PDF user space coordinates. * The coordinates of the point 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. */ get pdfEnd(): Point; /** * Gets or sets the end point of the line annotation in PDF user space coordinates. * The coordinates of the point 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. */ set pdfEnd(value: Point); /** * Gets or sets the line width in points. */ get lineWidth(): number; /** * Gets or sets the line width in points. */ set lineWidth(value: number); /** * Gets or sets the line dash pattern. Null means a solid line. */ get lineDashPattern(): number[] | null; /** * Gets or sets the line dash pattern. Null means a solid line. */ set lineDashPattern(value: number[] | null); /** * Gets or sets the style of line start. */ get lineStartStyle(): LineEndingStyle; /** * Gets or sets the style of line start. */ set lineStartStyle(value: LineEndingStyle); /** * Gets or sets the style of line end. */ get lineEndStyle(): LineEndingStyle; /** * Gets or sets the style of line end. */ set lineEndStyle(value: LineEndingStyle); /** * Gets or sets the interior color with which to fill the annotation's line endings. */ get lineEndingsFillColor(): Color; /** * Gets or sets the interior color with which to fill the annotation's line endings. */ set lineEndingsFillColor(value: Color); /** * Gets or sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular to the line itself. * A positive value means that the leader lines appear in the direction that is clockwise when traversing * the line from its starting point to its ending point. * A negative value indicates the opposite direction. */ get leaderLinesLength(): number; /** * Gets or sets the length of leader lines in default user space that extend from each endpoint of the line perpendicular to the line itself. * A positive value means that the leader lines appear in the direction that is clockwise when traversing * the line from its starting point to its ending point. * A negative value indicates the opposite direction. */ set leaderLinesLength(value: number); /** * Gets or sets a non-negative number representing the length of leader line extensions that extend * from the line proper 180 degrees from the leader lines. */ get leaderLinesExtension(): number; /** * Gets or sets a non-negative number representing the length of leader line extensions that extend * from the line proper 180 degrees from the leader lines. */ set leaderLinesExtension(value: number); /** * Gets or sets a non-negative number representing the length of the leader line offset, * which is the amount of empty space between the endpoints of the annotation and the beginning * of the leader lines. */ get leaderLineOffset(): number; /** * Gets or sets a non-negative number representing the length of the leader line offset, * which is the amount of empty space between the endpoints of the annotation and the beginning * of the leader lines. */ set leaderLineOffset(value: number); /** * Gets or sets the annotation's text positioning. */ get textPosition(): LineAnnotationTextPosition; /** * Gets or sets the annotation's text positioning. */ set textPosition(value: LineAnnotationTextPosition); /** * Gets or sets the horizontal offset along the annotation line from its midpoint, * with a positive value indicating offset to the right and a negative value indicating offset to the left. */ get horizontalTextOffset(): number; /** * Gets or sets the horizontal offset along the annotation line from its midpoint, * with a positive value indicating offset to the right and a negative value indicating offset to the left. */ set horizontalTextOffset(value: number); /** * Gets or sets the vertical offset perpendicular to the annotation line, with a positive value * indicating a shift up and a negative value indicating a shift down. */ get verticalTextOffset(): number; /** * Gets or sets the vertical offset perpendicular to the annotation line, with a positive value * indicating a shift up and a negative value indicating a shift down. */ set verticalTextOffset(value: number); }