Converting Word Documents (and other types of files) to PDF in a rails application

Discussion in 'Ruby' started by Brendon, Feb 13, 2007.

  1. Brendon

    Brendon Guest

    Hi everyone,

    I'm currently developing a Rails content management system, and one of
    the useful features we're trying to get sorted is a way to allow a
    user to upload a word document or some other type of regular file, and
    have it converted by the server to PDF.

    I've seen a java programme called Alfresco do this using Open Office,
    but I'm just wondering if there's another way that's more integrated
    with Ruby?

    If anyone knows if bits and pieces of tech already exist in this area
    but they just haven't been brought together in this way yet, I'd be
    keen to learn the names of these projects. Perhaps we can create a
    plugin as a result of our larger project.

    Looking forward to your ideas :)

    Cheers,

    Brendon
    Brendon, Feb 13, 2007
    #1
    1. Advertising

  2. Re: Converting Word Documents (and other types of files) to PDF ina rails application

    Brendon wrote:
    > Hi everyone,
    >
    > I'm currently developing a Rails content management system, and one of
    > the useful features we're trying to get sorted is a way to allow a
    > user to upload a word document or some other type of regular file, and
    > have it converted by the server to PDF.
    >
    > I've seen a java programme called Alfresco do this using Open Office,
    > but I'm just wondering if there's another way that's more integrated
    > with Ruby?
    >
    > If anyone knows if bits and pieces of tech already exist in this area
    > but they just haven't been brought together in this way yet, I'd be
    > keen to learn the names of these projects. Perhaps we can create a
    > plugin as a result of our larger project.
    >
    > Looking forward to your ideas :)
    >
    > Cheers,
    >
    > Brendon
    >

    There are open source things that kinda sorta almost work, but they're
    ephemeral by nature -- Microsoft proprietary formats are ... well ...
    proprietary. :) Abiword and OpenOffice.org can read most Word documents,
    and lots of tools can write PDFs. Here's a list of things I have on Gentoo:



    * dev-python/rtf2xml
    Latest version available: 1.32
    Latest version installed: [ Not Installed ]
    Unstable version: 1.32
    Use Flags (stable): -
    Size of downloaded files: 1,255 kB
    Homepage: http://rtf2xml.sourceforge.net/
    Description: Converts a Microsoft RTF file to structured XML
    License: GPL-2

    * dev-java/poi
    Latest version available: 2.5.1-r1
    Latest version installed: [ Not Installed ]
    Unstable version: 2.5.1-r1
    Use Flags (stable): -doc -elibc_FreeBSD -elibc_FreeBSD +source
    Size of downloaded files: 20,128 kB
    Homepage: http://jakarta.apache.org/poi/
    Description: Java API To Access Microsoft Format Files
    License: Apache-2.0

    * app-text/catdoc
    Latest version available: 0.94.1
    Latest version installed: [ Not Installed ]
    Unstable version: 0.94.1
    Use Flags (stable): +tk
    Size of downloaded files: 490 kB
    Homepage: http://www.45.free.net/~vitus/software/catdoc/
    Description: A convertor for Microsoft Word, Excel and RTF Files
    to text
    License: GPL-2

    * app-text/docfrac
    Latest version available: 3.1.1
    Latest version installed: [ Not Installed ]
    Unstable version: 3.1.1
    Use Flags (stable): -
    Size of downloaded files: 7,105 kB
    Homepage: http://docfrac.sourceforge.net/
    Description: rtf/html/text conversion utility
    License: LGPL-2.1

    * app-text/highlight
    Latest version available: 2.4.8
    Latest version installed: [ Not Installed ]
    Unstable version: 2.4.8
    Use Flags (stable): -
    Size of downloaded files: 925 kB
    Homepage: http://www.andre-simon.de/
    Description: converts source code to formatted text ((X)HTML, RTF,
    (La)TeX, XSL-FO, XML) with syntax highlighting.
    License: GPL-2

    * app-text/unrtf
    Latest version available: 0.20.1
    Latest version installed: [ Not Installed ]
    Unstable version: 0.20.1
    Use Flags (stable): -
    Size of downloaded files: 448 kB
    Homepage: http://www.gnu.org/software/unrtf/unrtf.html
    Description: Converts RTF files to various formats
    License: GPL-2

    * app-text/wv
    Latest version available: 1.2.3-r1
    Latest version installed: 1.2.3-r1
    Unstable version: 1.2.3-r1
    Use Flags (stable): +wmf
    Size of downloaded files: 1,844 kB
    Homepage: http://wvware.sourceforge.net/
    Description: Tool for conversion of MSWord doc and rtf files to
    something readable
    License: GPL-2

    * dev-python/pyrtf
    Latest version available: 0.45
    Latest version installed: [ Not Installed ]
    Unstable version: 0.45
    Use Flags (stable): -
    Size of downloaded files: 96 kB
    Homepage: http://pyrtf.sourceforge.net
    Description: A set of python classes that make it possible to
    produce RTF documents from python programs.
    License: || ( GPL-2 LGPL-2 )

    * dev-tex/latex2rtf
    Latest version available: 1.9.16
    Latest version installed: [ Not Installed ]
    Unstable version: 1.9.16
    Use Flags (stable): -doc
    Size of downloaded files: 1,856 kB
    Homepage: http://latex2rtf.sourceforge.net/
    Description: LaTeX to RTF converter
    License: GPL-2

    I think "wv" is the best of this crowd, but it's been a while since I
    had to eat a Word document on my Linux box. As far as Word-to-PDF is
    concerned, it's more or less built in to OpenOffice.org, so just
    shelling out to that might get the job done. Oo_O is quite a memory hog,
    though, so you'll probably want to fire it up as a server and leave it
    running.






    >
    >
    >



    --
    M. Edward (Ed) Borasky, FBG, AB, PTA, PGS, MS, MNLP, NST, ACMC(P)
    http://borasky-research.blogspot.com/

    If God had meant for carrots to be eaten cooked, He would have given rabbits fire.
    M. Edward (Ed) Borasky, Feb 13, 2007
    #2
    1. Advertising

  3. Brendon

    Guest

    Re: Converting Word Documents (and other types of files) to PDF ina rails application

    On Tue, 13 Feb 2007, Brendon wrote:

    > Hi everyone,
    >
    > I'm currently developing a Rails content management system, and one of
    > the useful features we're trying to get sorted is a way to allow a
    > user to upload a word document or some other type of regular file, and
    > have it converted by the server to PDF.
    >
    > I've seen a java programme called Alfresco do this using Open Office,
    > but I'm just wondering if there's another way that's more integrated
    > with Ruby?
    >
    > If anyone knows if bits and pieces of tech already exist in this area
    > but they just haven't been brought together in this way yet, I'd be
    > keen to learn the names of these projects. Perhaps we can create a
    > plugin as a result of our larger project.
    >
    > Looking forward to your ideas :)
    >
    > Cheers,
    >
    > Brendon


    i'd reccomend one of three approaches

    1) run windows under cross-over office on a linux box or under parallels on
    osx. then you can install ruby, under windows, and write a ruby application
    that does this using the native ms bindings

    2) setup a windows servers (two would be better) and run a simple drb
    service for converting doccuments - again using the native drivers and ruby

    3) use some online service such as http://www.zamzar.com/ and drive it via
    http libs/curl

    if it were me i'd go with 3 since any reliable method will ential keeping a
    windows box online (!!). you could could probably write producer code that
    posted files to a service and a consumer that checks a special email account
    for finished files in a few days...

    regards.

    -a
    --
    we can deny everything, except that we have the possibility of being better.
    simply reflect on that.
    - the dalai lama
    , Feb 13, 2007
    #3
  4. Brendon

    Brendon Guest

    Thank you both for your informative replys. :) I like the idea of an
    online service. As I was reading your first two options I quickly came
    to your conclusion :) !

    I'll post any learnings and methods on here when I have something
    working,

    Cheers,

    Brendon
    Brendon, Feb 13, 2007
    #4
  5. Brendon

    Chris Carter Guest

    On 2/12/07, Brendon <> wrote:
    > Hi everyone,
    >
    > I'm currently developing a Rails content management system, and one of
    > the useful features we're trying to get sorted is a way to allow a
    > user to upload a word document or some other type of regular file, and
    > have it converted by the server to PDF.
    >
    > I've seen a java programme called Alfresco do this using Open Office,
    > but I'm just wondering if there's another way that's more integrated
    > with Ruby?
    >
    > If anyone knows if bits and pieces of tech already exist in this area
    > but they just haven't been brought together in this way yet, I'd be
    > keen to learn the names of these projects. Perhaps we can create a
    > plugin as a result of our larger project.
    >
    > Looking forward to your ideas :)
    >
    > Cheers,
    >
    > Brendon
    >
    >
    >

    I think the best way might be to use RJB or JRuby and Jakarta
    Poi(http://jakarta.apache.org/poi/)

    --
    Chris Carter
    concentrationstudios.com
    brynmawrcs.com
    Chris Carter, Feb 13, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Darrel
    Replies:
    1
    Views:
    303
    Steve C. Orr [MVP, MCSD]
    Feb 18, 2005
  2. crazyprakash
    Replies:
    4
    Views:
    3,362
    adrian
    Oct 30, 2005
  3. Roger Withnell

    Downloading Word and pdf documents

    Roger Withnell, Jul 5, 2003, in forum: ASP General
    Replies:
    1
    Views:
    95
    Robb Meade
    Jul 6, 2003
  4. Ricardo Pog
    Replies:
    1
    Views:
    396
    Austin Ziegler
    Mar 26, 2008
  5. Sean Nakasone
    Replies:
    1
    Views:
    338
    Farrel Lifson
    Apr 14, 2008
Loading...

Share This Page