* Get the document trapped status. * * @returns The trapped status, or undefined if not set
()
| 1366 | * @returns The trapped status, or undefined if not set |
| 1367 | */ |
| 1368 | getTrapped(): TrappedStatus | undefined { |
| 1369 | const infoRef = this.ctx.info.trailer.getRef("Info"); |
| 1370 | |
| 1371 | if (!infoRef) { |
| 1372 | return undefined; |
| 1373 | } |
| 1374 | |
| 1375 | const info = this.ctx.registry.getObject(infoRef); |
| 1376 | |
| 1377 | if (!(info instanceof PdfDict)) { |
| 1378 | return undefined; |
| 1379 | } |
| 1380 | |
| 1381 | const trapped = info.getName("Trapped")?.value; |
| 1382 | |
| 1383 | if (trapped === "True" || trapped === "False" || trapped === "Unknown") { |
| 1384 | return trapped; |
| 1385 | } |
| 1386 | |
| 1387 | return undefined; |
| 1388 | } |
| 1389 | |
| 1390 | /** |
| 1391 | * Set the document trapped status. |
no test coverage detected