MCPcopy
hub / github.com/pmaupin/pdfrw / decode_hex

Method decode_hex

pdfrw/objects/pdfstring.py:391–398  ·  view source on GitHub ↗

Decode a PDF hexadecimal-encoded string, which is enclosed in angle brackets <>.

(self)

Source from the content-addressed store, hash-verified

389
390
391 def decode_hex(self):
392 """ Decode a PDF hexadecimal-encoded string, which is enclosed
393 in angle brackets <>.
394 """
395 hexstr = convert_store(''.join(self[1:-1].split()))
396 if len(hexstr) % 1: # odd number of chars indicates a truncated 0
397 hexstr += '0'
398 return binascii.unhexlify(hexstr)
399
400
401 def to_bytes(self):

Callers 1

to_bytesMethod · 0.95

Calls 1

convert_storeFunction · 0.85

Tested by

no test coverage detected