in reply to Re^2: Convert .doc to .pdf
in thread Convert .doc to .pdf

Very nice.

I just tried this with OO 2.0.2

Built the macro, as described in the article you linked to.

Since I was not interested in a CGI wrapper, the only interesting stuff in the the ASP/C# stuff in the download acompanying the article is how to call it (Win here):

path_to_OO_executables\swriter.exe macro:///ConversionLibrary.PDFConve +rsion.ConvertWordToPDF(Word.doc,Output.pdf)

(I used the same names as in the article)

Assemble that command line dynamically with the file names needed, run it as a background process, and you are done.

Worked fine, except for an "ErrorCodeIOException" occuring at the export call...

Hm, took me a few minutes to realise, that it was not my fault, but a known bug in V2.0.2. ;-/

Replies are listed 'Best First'.
Re^4: Convert .doc to .pdf
by dragonchild (Archbishop) on Feb 01, 2007 at 01:38 UTC
    You would earn the gratitude of thousands of Perlers if you would take that solution and wrap it in a CPAN distribution. Maybe take a look at Alien to guarantee the OpenOffice installation. It sounds dumb to release a CPAN distribution for just a few lines of a system call, but it's a really big deal to be able to interface with this process using a Perl module. And, if you built it generically enough, then you could very easily extend this to wrap all the format manipulations that OO provides. THAT would be awesome!

    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?