Friends, sometimes I had to create a self-contained PHP script. That means the PHP script could have any files within it due to some encoding/decoding algorithm, like Base64. For example, this code is a Base64 encoding of this tiny image:
Of course, in this particular case, PHP can handle that huge encoded string because it has a bundled base64_decode() function.
I was wondering if this idea is possible to achieve somehow in TeX/LaTeX. I need to point out that I'm just curious on this subject, not that I want to embed whatever in code. Besides, as you noted, the encoded string is huge, so that'd surely make people cry blood.
One possible solution I see is if somebody implement an encoding/decoding algorithm in TeX/LaTeX, like \base64_decode
, so it would be possible to use something like this: \includegraphics{\base64_decode{\myhugeunreadablestring}}
. Sorry for the acid trip ticket, but I'm really curious on how this insane code would work. =)
filecontents
) which writes it to a file where a command line tool turns it to the binary image which is then included as normal.filecontents
at all! I implemented your suggestion and it works perfectly!