base64 then, the solution to just about anything?
:-)
Well, base 64 would be a good solution, if iconv encoding converters recognised the image data inside the PDF and converted it to base 64 instead of just crapping out when the random bytes in the image do not make a valid encoding. (Image or any other binary that can be embedded in PDF).
If base 64 or any other no-NULs format is allowed in PDFs maybe the OP could use one of the PDF converters to do so before editing it in Geany.
But probably the best answer is for the OP to use an actual PDF editor, not try to edit PDF content in a text editor.