I'm trying to convert some Word .doc files to Adobe .pdf. In the process we're also changing the naming conventions so foo.doc might become bar.pdf as well as storing the new filename and path in a database.

We're not a Windows shop and don't have Word. So all the fancy stuff you might be able to do with the Win32::OLE modules isn't possible.

What I envisoned so far with the script is this:
1) Crawl specific directories
2) Pick out the .doc file
3) query the DB to figure out the new file name
4) convert the .doc file to .pdf
5) move the .pdf to the correct location
6) delete the old .doc file
7) update the DB with the new info
8) loop back to the start

With perl, I can do all except 4) convert the .doc file to .pdf. So first thing I did was check cpan.org. I didn't seem to find anything dealing with .doc to .pdf conversion. I found the PDF and PDF::API2 modules (I've used them before and I'm not thrilled to see them again). Everything I could find regarding Word seemed to be related to the Win32::OLE modules.

So any suggestions for converting .doc to .pdf on Linux?


In reply to Convert .doc to .pdf by xorl

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.