* Set an appearance stream by type.
(type: "N" | "R" | "D", stream: PdfStream)
| 396 | * Set an appearance stream by type. |
| 397 | */ |
| 398 | private setAppearance(type: "N" | "R" | "D", stream: PdfStream): void { |
| 399 | let ap = this.dict.getDict("AP", this.registry.resolve.bind(this.registry)); |
| 400 | |
| 401 | if (ap instanceof PdfDict) { |
| 402 | // Register the stream and store the reference |
| 403 | const streamRef = this.registry.register(stream); |
| 404 | |
| 405 | ap.set(type, streamRef); |
| 406 | |
| 407 | this.markModified(); |
| 408 | |
| 409 | return; |
| 410 | } |
| 411 | |
| 412 | ap = new PdfDict(); |
| 413 | this.dict.set("AP", ap); |
| 414 | } |
| 415 | |
| 416 | // ───────────────────────────────────────────────────────────────────────────── |
| 417 | // Change Tracking |
no test coverage detected