Decode a PDF hexadecimal-encoded string, which is enclosed in angle brackets <>.
(self)
| 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): |
no test coverage detected