Get pdf from mailhook

Hi all!

I’m trying to get the attached pdf to an email received in a mailhook to perform OCR actions.

The problem I’m facing is that the data file received via the mailhook is binary:

“data”: “IMTBuffer(15598, binary, 96eed20fbf20f3cf58645f951c6c42cfe6806790): 255044462d312e340d0a312030206f626a0d0a3c3c0d0a2f4…”

I’ve tried to convert it to base64 and upload it to google drive but the result is a pdf with the binary text inside:

Can someone help me here?

Thanks a ton