perlpreben has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I have exported a simple word document as w2007 xml. This stores images as base64 it seems;
/9j/4AAQSkZJRgABAgEASABIAAD/wAARCAE3AwEDAREAAhEBAxEB/9sAhAABAQEBAQEBAQ +EBAQEB AQEBAQEBAQEBAQEBAQEBAQEBAQEBAQICAgECAgIBAQIDAgICAgMDAwECAwMDAgMCAgMCAQ +EBAQEB AQEBAQECAQEBAQICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg +ICAgIC AgL/xAGiAAABBQEBAQEBAQAAAAAAAAAAAQIDBAUGBwgJCgsQAA
Seems simple. What I want to do is to convert a jpeg to base64, so I can import it into an xml .. and have word display it.
So I try;
use MIME::Base64 qw(encode_base64); open(FILE, "1.jpg") or die "$!"; binmode FILE; while (read(FILE, $buf, 60*57)) { print encode_base64($buf); }
And when I open the word document, the picture is rubbish. BUT i can see traces of the original picture, so im headed in the right direction at least.
Anyone got any advice on this? Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Word 2007 XML format and perl
by InfiniteSilence (Curate) on Feb 13, 2010 at 23:07 UTC | |
by perlpreben (Beadle) on Feb 14, 2010 at 11:21 UTC |