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

In reply to Re: More PDF troubles by Corion
in thread More PDF troubles by ruhk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.