Converting MSWord Docs to PDF

M

melv

Hello,

this is my first message sent to the python-list, so
forgive any irregularities.

is it possible to convert MSword docs into PDF format?
i told my future employer that i could, because i knew
of the COM scripting abilites that activePython had.
and i knew there was modules for PDF creation such as
reportlabs.

thanks

Melv
 
S

Steve Holden

Sybren said:
(e-mail address removed) enlightened us with:



Yes, it is. check out http://www.stuvel.eu/ooo-python#header3. It's
about converting Excel to PDF, but it equally applies to MSWord.
However, this assumed perfect import of the .doc file into Open Office,
which can't be guaranteed (though it gets better every release). So you
may want to do some experimentation to find out how well the import
proceeds.

If that *isn't* satisfactory then a modest investment in Adobe
Acrobat/Distiller plus the use of Python's scripting facilities to
direct the conversion would be preferable to spending a huge amount of
time writing a hand-crafted solution.

And the next time you are bragging in that way, couch your boasts in
conditional terms to avoid losing face should you happen to be wrong. A
lot will depend on the complexity of the Word documents.

regards
Steve
 
A

Alan Franzoni

Il Tue, 10 Oct 2006 01:27:35 -0700, (e-mail address removed) ha scritto:
is it possible to convert MSword docs into PDF format?
i told my future employer that i could, because i knew
of the COM scripting abilites that activePython had.
and i knew there was modules for PDF creation such as
reportlabs.

a lot depends on the availability of ms word itself on the platform you're
planning to do the work, if you want the result to be perfect. There're
several tools on Windows (some cheap, some freeware) like FreePDF o
pdffactory, which act like 'Virtual Printers' producing a PDF file instead;
you could try using Python to automate the printing process and getting the
PDF output instead. Or if you've got access to Adobe Acrobat as well, you
could automate the whole process via Acrobat (but it's untested, don't take
it as granted).

If you're doing this in Linux, you should consider something like Crossover
Office in order to run ms word and convert its output.

The openoffice.org based solution will surely work, but you'll heavily rely
on the conversion quality of that suite.

--
Alan Franzoni <[email protected]>
-
Togli .xyz dalla mia email per contattarmi.
Rremove .xyz from my address in order to contact me.
-
GPG Key Fingerprint:
5C77 9DC3 BD5B 3A28 E7BC 921A 0255 42AA FE06 8F3E
-
Blog: http://laterradeglieroi.verdiperronchi.com
 
A

Andrew McLean

Steve said:
If that *isn't* satisfactory then a modest investment in Adobe
Acrobat/Distiller plus the use of Python's scripting facilities to
direct the conversion would be preferable to spending a huge amount of
time writing a hand-crafted solution.

An alternative to Adobe Distiller (part of Acrobat) is PDFCreator

http://sourceforge.net/projects/pdfcreator/

which is free. This installs as a Windows printer (using GhostScript as
a backend to generate PDFs). It should be relatively straightforward to
use Python scripting to drive Word to "print" documents to the
PDFCreator pseudo-printer.
 
S

Steve Holden

Andrew said:
An alternative to Adobe Distiller (part of Acrobat) is PDFCreator

http://sourceforge.net/projects/pdfcreator/

which is free. This installs as a Windows printer (using GhostScript as
a backend to generate PDFs). It should be relatively straightforward to
use Python scripting to drive Word to "print" documents to the
PDFCreator pseudo-printer.

Nice one, thanks for that, I'd missed it.

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top