* Set the annotation rectangle.
(rect: Rect)
| 109 | * Set the annotation rectangle. |
| 110 | */ |
| 111 | setRect(rect: Rect): void { |
| 112 | const arr = this.dict.getArray("Rect", this.registry.resolve.bind(this.registry)); |
| 113 | |
| 114 | if (arr && arr.length >= 4) { |
| 115 | arr.set(0, PdfNumber.of(rect.x)); |
| 116 | arr.set(1, PdfNumber.of(rect.y)); |
| 117 | arr.set(2, PdfNumber.of(rect.x + rect.width)); |
| 118 | arr.set(3, PdfNumber.of(rect.y + rect.height)); |
| 119 | } else { |
| 120 | this.dict.set( |
| 121 | "Rect", |
| 122 | new PdfArray([ |
| 123 | PdfNumber.of(rect.x), |
| 124 | PdfNumber.of(rect.y), |
| 125 | PdfNumber.of(rect.x + rect.width), |
| 126 | PdfNumber.of(rect.y + rect.height), |
| 127 | ]), |
| 128 | ); |
| 129 | } |
| 130 | |
| 131 | this.markModified(); |
| 132 | } |
| 133 | |
| 134 | /** |
| 135 | * Text content or description of the annotation. |
nothing calls this directly
no test coverage detected