PDF-writer and MS word document

Hi guys,

I just wonder if anyone out there ever uses PDF::Writer to create a PDF
file from a MS word document file. I can only create a PDF file if the
file is in plain text format.

Thanks,

Li

Li Chen wrote:

Hi guys,

I just wonder if anyone out there ever uses PDF::Writer to create a PDF
file from a MS word document file. I can only create a PDF file if the
file is in plain text format.

Thanks,

Li

You might want have to write some sort of a macro or script file which
opens up word, dumps the document to text so you can do your conversion.

An easier approach would be to use a PDF print driver

CatLady [] wrote:

You might want have to write some sort of a macro or script file which
opens up word, dumps the document to text so you can do your conversion.

An easier approach would be to use a PDF print driver.

Do you know which is most popular and compatible with in Ruby?

Thanks,

Li

CatLady [] wrote:

You might want have to write some sort of a macro or script file which
opens up word, dumps the document to text so you can do your conversion.

An easier approach would be to use a PDF print driver

There are some filters available on most open-source platforms that will
do a fair job of this. OpenOffice.org will also do a fair to
acceptable job of this. For the most part, though, making high-quality
PDFs of a Word document requires either buying software for a Windows
platform or using the Adobe service that converts documents on the web.

Creating high-quality PDFs from original documents is much easier in
the open source world. TeX and all its trappings, DVI, PostScript,
Scribus, Inkscape, etc. offer excellent PDF output. The tricky part is
getting the information from the Word document.

If you are on Mac, simply print to the Adobe PDF printer.
If you are on Windows, download something like PDF995 which creates a
PDF printer for you.
If you are on Linux, I don’t think you have the printer option.
OpenOffice should be able to export a PDF, and you could figure a way
to finagle an API there somewhere most likely.

PDF::Writer is difficult because (to my knowledge) there is no way to
extract data from a Word file programmatically, with the exception of
perhaps using the application “antiword” to extract the text and then
using PDF::Writer to write that back. Not your best option (because
formatting and such is lost), but it is an option.

–Jeremy

On 10/30/06, Li Chen [email protected] wrote:

CatLady [] wrote:

You might want have to write some sort of a macro or script file which
opens up word, dumps the document to text so you can do your conversion.

An easier approach would be to use a PDF print driver.
Do you know which is most popular and compatible with in Ruby?

You’re not looking for something to run from Ruby. You’re looking for
a program that understands the (proprietary) Microsoft Word format and
can write the (semi-open) PDF format. The absolute best way to do this
is to open the document in Word and print it through Acrobat. Lesser
ways include opening the document in OpenOffice and exporting it as a
PDF.

Alternatively, you can try something like PDFCamp (works on Windows):
http://www.verypdf.com/pdfcamp/pdf-writer/word-to-acrobat.html

You might be able to use http://www.pdfonline.com/ to convert, but I’m
not sure they’d want you doing a third-party conversion in your own
application. Or maybe http://www.primopdf.com/ if you want to consider
that. Or http://www.convertzone.com/doc2pdf/help.htm. Or try FastPDF:
http://www.fastpdf.com/.

PDF::Writer will never have this capability directly, and even if
someone were to create a Word document parser, it is unlikely that
formatting would be preserved exactly. It might be more likely to see
a PostScript parser, but even that is unlikely.

-austin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs