|The stupid question is the question not asked|
Problem Encoding/Decoding PDF with MIME::Base64by DamnDirtyApe (Curate)
|on Apr 28, 2004 at 20:57 UTC||Need Help??|
DamnDirtyApe has asked for the wisdom of the Perl Monks concerning the following question:
G'day, monks. I've been playing with SQLite alot lately, and I'm trying to find a way to add binary attachments to the database. The SQLite docs recommend Base64 encoding, so I thought I'd experiment with that a bit.
Here's my program to encode files in Base64:
And the matching decode program:
Here's what I tried to test it:
When I try to open yis.pdf with Acrobat Reader, it says there's an error in the file. The original PDF works fine. Any suggestions?
UPDATE: I moved these PDFs to my Linux box and used hexdump -C to look at them - it looks like an endline issue (yis.pdf has Windows-style endlines). I tried adding local $/ = "\n"; to each file, but that didn't seem to help.
Those who know that they are profound strive for clarity. Those who would like to seem profound to the crowd strive for obscurity. --Friedrich Nietzsche