Copy only the base64 encoded text into a new text file foo.txt
.
base64 --decode foo.txt > bar.pdf
I just decoded a base64 stream that had an extra bit on the end that I had to remove. It looked like this: --=_59494bda030d4629113a60ff13935d81--
. Before I removed it I got the error: Invalid character in input stream.
After I deleted it, no decoding errors and it opened just fine.