* Extract the file ID from the trailer's /ID array. * Returns the first element of the array (the permanent file ID).
(trailer: PdfDict)
| 881 | * Returns the first element of the array (the permanent file ID). |
| 882 | */ |
| 883 | private getFileId(trailer: PdfDict): Uint8Array | null { |
| 884 | const idArray = trailer.getArray("ID"); |
| 885 | |
| 886 | if (!idArray || idArray.length < 1) { |
| 887 | return null; |
| 888 | } |
| 889 | |
| 890 | const firstId = idArray.at(0); |
| 891 | |
| 892 | if (firstId instanceof PdfString) { |
| 893 | return firstId.bytes; |
| 894 | } |
| 895 | |
| 896 | return null; |
| 897 | } |
| 898 | |
| 899 | /** |
| 900 | * Check if bytes at position match a pattern. |
no test coverage detected