* Get or create the ViewerPreferences dictionary.
()
| 1519 | * Get or create the ViewerPreferences dictionary. |
| 1520 | */ |
| 1521 | private getOrCreateViewerPreferences(): PdfDict { |
| 1522 | const catalog = this.ctx.catalog.getDict(); |
| 1523 | const existing = catalog.getDict("ViewerPreferences", this.ctx.resolve.bind(this.ctx)); |
| 1524 | |
| 1525 | if (existing) { |
| 1526 | return existing; |
| 1527 | } |
| 1528 | |
| 1529 | // Create new ViewerPreferences |
| 1530 | const prefs = new PdfDict(); |
| 1531 | catalog.set("ViewerPreferences", prefs); |
| 1532 | |
| 1533 | return prefs; |
| 1534 | } |
| 1535 | |
| 1536 | // ───────────────────────────────────────────────────────────────────────────── |
| 1537 | // Object access |