sago has asked for the wisdom of the Perl Monks concerning the following question:


I want to convert a microsoft word document to pdf file format using perl script.

Could please tell me which module or the code for it?

Replies are listed 'Best First'.
Re: Word document to pdf file
by marto (Cardinal) on Jun 17, 2008 at 09:22 UTC
Re: Word document to pdf file
by psini (Deacon) on Jun 17, 2008 at 09:36 UTC

    I don't know any simple approach in Perl, but you could want to take a look at this. It is a standalone doc to pdf converter and if it meets your requirements it should be easy enough to use from a Perl program

    Careful with that hash Eugene.

Re: Word document to pdf file
by leocharre (Priest) on Jun 17, 2008 at 13:48 UTC

    You want to

    1. use antiword
      This will turn a silly m$ "word" file into simple text. Some formatting will be lost.
    2. use PDF::API2 to turn the output into a pdf file.

    There is no point blank solution with this approach. You will have to code this.

    Better yet, tell whomever is giving you m$ werd files to stop it. - Wait wait.. is it corporate? Are they telling ya - "no.. it has to be word to pdf.. we have all these word docs but our clients- some of them are silly people who don't have word ... we need them as pdf files so they can see them! And it must look the same!" - only.. the client machines can see it as if they had m$ werd.

    Tell them they can choose but the solutions are what you offer. They are welcome to say 'no'.