The easiest way to convert a Word document to PDF is to set up a special machine, with the default printer a PDF converter, and automate Word to print the document (via Win32::OLE).
Parsing and recreating Word input/output is not easily done - maybe you can also install and automate the OpenOffice.Org suite, which possibly can read *.doc files, and they for sure have an .pdf output option.
If you're in for a pure Perl solution, I fear that the closest thing available is SpreadSheet::ParseExcel, which should do most of the OLE-Stream parsing, but which will know nothing about Word...
Personally, I would tell the people to either upload an image, text or a PDF and thus put the burden of producing a suitable PDF file on them - it isn't hard with either a Mac or a Windows PC and even the Unix users should know how to coax their tool of choice to produce a suitable PDF.
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The
$d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider
($c = $d->accept())->get_request(); $c->send_response( new #in the
HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web
| [reply] [d/l] |
If it were up to me I would just require the user to convert it to PDF ( our campus has a site liscense to Acrobat Writer.) However, it has to be done this way, and it has to be a perl only or near perl only solution. One thing I am looking into is to go from word->html and then html->pdf.
| [reply] |
use redmon (a port redirector utility) in combination with ghostscript, on either platform, to print pdf from any program that uses standard OS printing facilities. redmon web page tells you how to set it up. You can then do the conversions manually OR via OLE. | [reply] |