MCPcopy Create free account
hub / github.com/LibPDF-js/core / parseToUnicodeMap

Function parseToUnicodeMap

src/document/forms/form-font.ts:448–460  ·  view source on GitHub ↗
(type0Dict: PdfDict, resolver: RefResolver)

Source from the content-addressed store, hash-verified

446}
447
448function parseToUnicodeMap(type0Dict: PdfDict, resolver: RefResolver): ToUnicodeMap | null {
449 const toUnicode = type0Dict.get("ToUnicode", resolver);
450
451 if (!(toUnicode instanceof PdfStream)) {
452 return null;
453 }
454
455 try {
456 return parseToUnicode(toUnicode.getDecodedData());
457 } catch {
458 return null;
459 }
460}
461
462/**
463 * Check if a font is an EmbeddedFont.

Callers 1

Calls 3

parseToUnicodeFunction · 0.90
getDecodedDataMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected