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

Method asString

src/objects/pdf-string.ts:33–35  ·  view source on GitHub ↗

* Decode as PDF text string (auto-detects encoding). * * PDF text strings use either PDFDocEncoding (single-byte, similar to Latin-1) * or UTF-16BE with BOM (0xFE 0xFF prefix). This method auto-detects and decodes.

()

Source from the content-addressed store, hash-verified

31 * or UTF-16BE with BOM (0xFE 0xFF prefix). This method auto-detects and decodes.
32 */
33 asString(): string {
34 return decodeTextString(this.bytes);
35 }
36
37 /**
38 * Create a PdfString from text (auto-selects encoding).

Callers 15

fromCatalogMethod · 0.80
file-spec.test.tsFile · 0.80
decodeFilenameFunction · 0.80
parseFileSpecFunction · 0.80
pdf-string.test.tsFile · 0.80
pdf-dict.test.tsFile · 0.80
getLayersFunction · 0.80

Calls 1

decodeTextStringFunction · 0.90

Tested by

no test coverage detected