def asciihexdecode(data):
    """
    ASCIIHexDecode filter: PDFReference v1.4 section 3.3.1
    For each pair of ASCII hexadecimal digits (0-9 and A-F or a-f), the
    ASCIIHexDecode filter produces one byte of binary data. All white-space
    characters are ignored. A right angle bracket character (>) indicates
    EOD. Any other characters will cause an error. If the filter encounters
    the EOD marker after reading an odd number of hexadecimal digits, it
    will behave as if a 0 followed the last digit.

    >>> asciihexdecode(b'61 62 2e6364   65')
    b'ab.cde'
    >>> asciihexdecode(b'61 62 2e6364   657>')
    b'ab.cdep'
    >>> asciihexdecode(b'7>')
    b'p'
    """
    data = data.decode('latin1')
    out = [ int(hx,16) for hx in  hex_re.findall(data) ]
    m = trail_re.search(data)
    if m:
        out.append(int(m.group(1),16) << 4)
    return bytes(out)

    ASCIIHexDecode filter: PDFReference v1.4 section 3.3.1
    For each pair of ASCII hexadecimal digits (0-9 and A-F or a-f), the
    ASCIIHexDecode filter produces one byte of binary data. All white-space
    characters are ignored. A right angle bracket character (>) indicates
    EOD. Any other characters will cause an error. If the filter encounters
    the EOD marker after reading an odd number of hexadecimal digits, it
    will behave as if a 0 followed the last digit.

    >>> asciihexdecode(b'61 62 2e6364   65')
    b'ab.cde'
    >>> asciihexdecode(b'61 62 2e6364   657>')
    b'ab.cdep'
    >>> asciihexdecode(b'7>')
    b'p'
    
pdfminer/ascii85.py