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

Method fromHex

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

* Create a PdfString from a hex string (e.g., "48656C6C6F"). * Whitespace is ignored. Odd-length strings are padded with 0.

(hex: string)

Source from the content-addressed store, hash-verified

53 * Whitespace is ignored. Odd-length strings are padded with 0.
54 */
55 static fromHex(hex: string): PdfString {
56 return new PdfString(hexToBytes(hex), "hex");
57 }
58
59 /**
60 * Create a PdfString from raw bytes.

Callers 7

createR2DictFunction · 0.80
createR4DictFunction · 0.80
createR6DictFunction · 0.80
pdf-object.test.tsFile · 0.80
pdf-string.test.tsFile · 0.80
serializer.test.tsFile · 0.80

Calls 1

hexToBytesFunction · 0.90

Tested by 3

createR2DictFunction · 0.64
createR4DictFunction · 0.64
createR6DictFunction · 0.64