# Doc to PDF/HTML converter plugins available in Ruby?

**URL:** <https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469>\
**Category:** ruby-talk\
**Created:** [18 February 2007 17:07 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469 "2007-02-18T17:07:57Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Invincible\_Code](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@Invincible\_Code](https://rubytalk.org/u/Invincible_Code)\
**Post date:** [18 February 2007 17:07 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/1 "2007-02-18T17:07:57Z")

</div>

Hi,

Are there any .doc to pdf and html comverter library available in Ruby?

Thanks in advance,  
Invincible

---

<div class="post-metadata">

**Author:** ![Jason\_Mayer](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@Jason\_Mayer](https://rubytalk.org/u/Jason_Mayer)\
**Post date:** [18 February 2007 17:18 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/2 "2007-02-18T17:18:41Z")

</div>

a quick search of the ruby kitchen sink ([http://rubykitchensink.ca/\](http://rubykitchensink.ca/%5C))  
referred me to this:

[http://ruby-pdf.rubyforge.org/pdf-writer/](http://ruby-pdf.rubyforge.org/pdf-writer/)

> **···**
>
> On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:
> 
> > Hi,
> > 
> > Are there any .doc to pdf and html comverter library available in Ruby?
> > 
> > Thanks in advance,  
> > Invincible

---

<div class="post-metadata">

**Author:** ![Invincible\_Code](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@Invincible\_Code](https://rubytalk.org/u/Invincible_Code)\
**Post date:** [18 February 2007 17:22 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/3 "2007-02-18T17:22:06Z")

</div>

Hi Jason,

Yes pdf-writer exists. but what I am looking at is some library/plugin which  
takes as input, a word doc and using may be pdf-writer generates a pdf  
document.

-Invincible

> **···**
>
> On 2/18/07, Jason Mayer \<slamboy@gmail.com\> wrote:
> 
> > On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > \>  
> > \> Hi,  
> > \>  
> > \> Are there any .doc to pdf and html comverter library available in Ruby?  
> > \>  
> > \> Thanks in advance,  
> > \> Invincible  
> > \>
> > 
> > a quick search of the ruby kitchen sink ([http://rubykitchensink.ca/\](http://rubykitchensink.ca/%5C))  
> > referred me to this:
> > 
> > [http://ruby-pdf.rubyforge.org/pdf-writer/](http://ruby-pdf.rubyforge.org/pdf-writer/)

---

<div class="post-metadata">

**Author:** ![Jason\_Mayer](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@Jason\_Mayer](https://rubytalk.org/u/Jason_Mayer)\
**Post date:** [18 February 2007 17:26 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/4 "2007-02-18T17:26:15Z")

</div>

Ah yes, sorry, I was distracted by my daughter so I didn't read your  
original email correctly. My apologies.

> **···**
>
> On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:
> 
> > Hi Jason,
> > 
> > Yes pdf-writer exists. but what I am looking at is some library/plugin  
> > which  
> > takes as input, a word doc and using may be pdf-writer generates a pdf  
> > document.
> > 
> > -Invincible

---

<div class="post-metadata">

**Author:** ![Jason\_Mayer](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@Jason\_Mayer](https://rubytalk.org/u/Jason_Mayer)\
**Post date:** [18 February 2007 17:30 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/5 "2007-02-18T17:30:23Z")

</div>

[http://www.curioso.org/2004/11/05/word2postscript/#more-65](http://www.curioso.org/2004/11/05/word2postscript/#more-65)

> **···**
>
> On 2/18/07, Jason Mayer \<slamboy@gmail.com\> wrote:
> 
> > On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > \>  
> > \> Hi Jason,  
> > \>  
> > \> Yes pdf-writer exists. but what I am looking at is some library/plugin  
> > \> which  
> > \> takes as input, a word doc and using may be pdf-writer generates a pdf  
> > \> document.  
> > \>  
> > \> -Invincible
> > 
> > Does this help any?

---

<div class="post-metadata">

**Author:** ![Jason\_Mayer](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@Jason\_Mayer](https://rubytalk.org/u/Jason_Mayer)\
**Post date:** [18 February 2007 17:32 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/6 "2007-02-18T17:32:51Z")

</div>

Ack. I'll give up until my wife comes back home. Heh.

> **···**
>
> On 2/18/07, Jason Mayer \<slamboy@gmail.com\> wrote:
> 
> > On 2/18/07, Jason Mayer \<slamboy@gmail.com\> wrote:  
> > \>  
> > \> On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > \> \>  
> > \> \> Hi Jason,  
> > \> \>  
> > \> \> Yes pdf-writer exists. but what I am looking at is some library/plugin  
> > \> \> which  
> > \> \> takes as input, a word doc and using may be pdf-writer generates a pdf  
> > \> \> document.  
> > \> \>  
> > \> \> -Invincible

---

<div class="post-metadata">

**Author:** ![Invincible\_Code](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@Invincible\_Code](https://rubytalk.org/u/Invincible_Code)\
**Post date:** [18 February 2007 17:52 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/7 "2007-02-18T17:52:56Z")

</div>

ok so the link says that first convert doc to postscript and then figure out  
how to convert postscript to pdf.

On searching I found another solution which requires openoffice and dblatex  
to be installed. I am figuring them out if they are feasible..  
Following steps would be required for the doc to pdf conversion,

1. Install open office  
2. Convert Microsoft Word to Docbook XML using Ruby and OpenOffice  
[http://www.juretta.com/log/2006/08/10/convert\_microsoft\_word\_to\_docbook\_xml\_using\_ruby\_and\_openoffice/](http://www.juretta.com/log/2006/08/10/convert_microsoft_word_to_docbook_xml_using_ruby_and_openoffice/)  
3. Convert Docbook XML to pdf using [http://dblatex.sourceforge.net/\](http://dblatex.sourceforge.net/%5C).  
[http://dblatex.sourceforge.net/](http://dblatex.sourceforge.net/)  
[http://developer.skolelinux.no/itil/Makefile](http://developer.skolelinux.no/itil/Makefile)  
[Success converting wiki page to PDF](http://lists.debian.org/debian-edu/2006/05/msg00017.html)

Jason, on reading the code, looks like the document is being read and being  
printed to a "Apache pdf" file.  
The script is referring to Win32,Win32::API,Win32::OLE ...does that mean it  
will work only on Windows?

-Invincible

> **···**
>
> On 2/18/07, Jason Mayer \<slamboy@gmail.com\> wrote:
> 
> > On 2/18/07, Jason Mayer \<slamboy@gmail.com\> wrote:  
> > \>  
> > \> On 2/18/07, Jason Mayer \<slamboy@gmail.com\> wrote:  
> > \> \>  
> > \> \> On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > \> \> \>  
> > \> \> \> Hi Jason,  
> > \> \> \>  
> > \> \> \> Yes pdf-writer exists. but what I am looking at is some  
> > library/plugin  
> > \> \> \> which  
> > \> \> \> takes as input, a word doc and using may be pdf-writer generates a  
> > pdf  
> > \> \> \> document.  
> > \> \> \>  
> > \> \> \> -Invincible  
> > \>
> > 
> > Ack. I'll give up until my wife comes back home. Heh.

---

<div class="post-metadata">

**Author:** ![Aur\_Saraf](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Aur\_Saraf](https://rubytalk.org/u/Aur_Saraf)\
**Post date:** [18 February 2007 19:00 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/8 "2007-02-18T19:00:33Z")

</div>

I recall something VERY similar being discussed on the list a few days  
ago, have a search 🙂

---

<div class="post-metadata">

**Author:** ![Aur\_Saraf](https://avatars.discourse-cdn.com/v4/letter/a/bcef8e/32.png) [@Aur\_Saraf](https://rubytalk.org/u/Aur_Saraf)\
**Post date:** [18 February 2007 19:05 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/9 "2007-02-18T19:05:14Z")

</div>

Here. Sorry for being lazy.

[http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/238888?238688-239295](http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-talk/238888?238688-239295)

To any whom might read this: PLUG of the adopt-a-newbie thread, if you  
feel like you're not comfortable with Ruby yet this might help YOU!  
🙂

Aur Saraf

> **···**
>
> On 2/18/07, SonOfLilit \<sonoflilit@gmail.com\> wrote:
> 
> > I recall something VERY similar being discussed on the list a few days  
> > ago, have a search 🙂

---

<div class="post-metadata">

**Author:** ![Invincible\_Code](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@Invincible\_Code](https://rubytalk.org/u/Invincible_Code)\
**Post date:** [18 February 2007 19:05 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/10 "2007-02-18T19:05:57Z")

</div>

I have got through following,

[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458)

Was there any other thread as well?

-Invincible.

> **···**
>
> On 2/19/07, SonOfLilit \<sonoflilit@gmail.com\> wrote:
> 
> > I recall something VERY similar being discussed on the list a few days  
> > ago, have a search 🙂

---

<div class="post-metadata">

**Author:** ![Invincible\_Code](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@Invincible\_Code](https://rubytalk.org/u/Invincible_Code)\
**Post date:** [18 February 2007 19:23 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/11 "2007-02-18T19:23:56Z")

</div>

Aur, Thanks for the link!

Regards  
Jatinder

> **···**
>
> On 2/19/07, Invincible Code \<invincible.coder@gmail.com\> wrote:
> 
> > I have got through following,
> > 
> > [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458)
> > 
> > Was there any other thread as well?
> > 
> > -Invincible.
> > 
> > On 2/19/07, SonOfLilit \<sonoflilit@gmail.com\> wrote:  
> > \>  
> > \> I recall something VERY similar being discussed on the list a few days  
> > \> ago, have a search 🙂  
> > \>

---

<div class="post-metadata">

**Author:** ![Jason\_Mayer](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@Jason\_Mayer](https://rubytalk.org/u/Jason_Mayer)\
**Post date:** [18 February 2007 22:25 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/12 "2007-02-18T22:25:55Z")

</div>

Ok, now that I've got a moment, here's an alternative using openoffice  
instead of MS Office. It's a nice printer friendly page as well.

[http://www.xml.com/lpt/a/1638](http://www.xml.com/lpt/a/1638)

apparently it works on .doc files made in office versions back through '97.  
I dunno if that'd be a better fit than the approach laid out by aur, but  
hey, I wanted to bring a real answer to the table 🙂

> **···**
>
> On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:
> 
> > Aur, Thanks for the link!
> > 
> > Regards  
> > Jatinder
> > 
> > On 2/19/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > \>  
> > \> I have got through following,  
> > \>  
> > \> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458)  
> > \>  
> > \> Was there any other thread as well?  
> > \>  
> > \> -Invincible.  
> > \>  
> > \> On 2/19/07, SonOfLilit \<sonoflilit@gmail.com\> wrote:  
> > \> \>  
> > \> \> I recall something VERY similar being discussed on the list a few days  
> > \> \> ago, have a search 🙂

---

<div class="post-metadata">

**Author:** ![Invincible\_Code](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@Invincible\_Code](https://rubytalk.org/u/Invincible_Code)\
**Post date:** [19 February 2007 13:29 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/13 "2007-02-19T13:29:27Z")

</div>

I hope it works for Microsoft 2000 and onwards as well.

btw I found a solution yesterday by using pdfcreator free utility which  
basically creats a virtual printer and lets me print my word doccument to  
the virtual printer which is nothing but a pdf target.  
However this appraoch has following limitations,  
1. Works only on Windows machine.

I am going to try out openoffice solution and see if it fits my needs.

I appreciate all your help.  
Thanks  
Invincible

> **···**
>
> On 2/19/07, Jason Mayer \<slamboy@gmail.com\> wrote:
> 
> > On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > \>  
> > \> Aur, Thanks for the link!  
> > \>  
> > \> Regards  
> > \> Jatinder  
> > \>  
> > \> On 2/19/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > \> \>  
> > \> \> I have got through following,  
> > \> \>  
> > \> \> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458)  
> > \> \>  
> > \> \> Was there any other thread as well?  
> > \> \>  
> > \> \> -Invincible.  
> > \> \>  
> > \> \> On 2/19/07, SonOfLilit \<sonoflilit@gmail.com\> wrote:  
> > \> \> \>  
> > \> \> \> I recall something VERY similar being discussed on the list a few  
> > days  
> > \> \> \> ago, have a search 🙂  
> > \>
> > 
> > Ok, now that I've got a moment, here's an alternative using openoffice  
> > instead of MS Office. It's a nice printer friendly page as well.
> > 
> > [http://www.xml.com/lpt/a/1638](http://www.xml.com/lpt/a/1638)
> > 
> > apparently it works on .doc files made in office versions back through  
> > '97.  
> > I dunno if that'd be a better fit than the approach laid out by aur, but  
> > hey, I wanted to bring a real answer to the table 🙂

---

<div class="post-metadata">

**Author:** ![Hugh\_A\_Cayless](https://avatars.discourse-cdn.com/v4/letter/h/c57346/32.png) [@Hugh\_A\_Cayless](https://rubytalk.org/u/Hugh_A_Cayless)\
**Post date:** [19 February 2007 13:51 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/14 "2007-02-19T13:51:15Z")

</div>

You might look at [http://www.artofsolving.com/opensource/jodconverter](http://www.artofsolving.com/opensource/jodconverter) which uses the OpenOffice API to run document conversions through it. I used it in a project last year, and it seems to work quite well on Linux. Since it runs as a web service, calling out to it from Ruby is straightforward.

Hugh

> **···**
>
> On Feb 19, 2007, at 8:29 AM, Invincible Code wrote:
> 
> > I hope it works for Microsoft 2000 and onwards as well.
> > 
> > btw I found a solution yesterday by using pdfcreator free utility which  
> > basically creats a virtual printer and lets me print my word doccument to  
> > the virtual printer which is nothing but a pdf target.  
> > However this appraoch has following limitations,  
> > 1. Works only on Windows machine.
> > 
> > I am going to try out openoffice solution and see if it fits my needs.
> > 
> > I appreciate all your help.  
> > Thanks  
> > Invincible
> > 
> > On 2/19/07, Jason Mayer \<slamboy@gmail.com\> wrote:
> > 
> > > On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > > \>  
> > > \> Aur, Thanks for the link!  
> > > \>  
> > > \> Regards  
> > > \> Jatinder  
> > > \>  
> > > \> On 2/19/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > > \> \>  
> > > \> \> I have got through following,  
> > > \> \>  
> > > \> \> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/165458)  
> > > \> \>  
> > > \> \> Was there any other thread as well?  
> > > \> \>  
> > > \> \> -Invincible.  
> > > \> \>  
> > > \> \> On 2/19/07, SonOfLilit \<sonoflilit@gmail.com\> wrote:  
> > > \> \> \>  
> > > \> \> \> I recall something VERY similar being discussed on the list a few  
> > > days  
> > > \> \> \> ago, have a search 🙂  
> > > \>
> > > 
> > > Ok, now that I've got a moment, here's an alternative using openoffice  
> > > instead of MS Office. It's a nice printer friendly page as well.
> > > 
> > > [http://www.xml.com/lpt/a/1638](http://www.xml.com/lpt/a/1638)
> > > 
> > > apparently it works on .doc files made in office versions back through  
> > > '97.  
> > > I dunno if that'd be a better fit than the approach laid out by aur, but  
> > > hey, I wanted to bring a real answer to the table 🙂

---

<div class="post-metadata">

**Author:** ![Invincible\_Code](https://avatars.discourse-cdn.com/v4/letter/i/ee59a6/32.png) [@Invincible\_Code](https://rubytalk.org/u/Invincible_Code)\
**Post date:** [19 February 2007 17:57 UTC](https://rubytalk.org/t/doc-to-pdf-html-converter-plugins-available-in-ruby/35469/15 "2007-02-19T17:57:09Z")

</div>

Hi Hugh,

Thanks for the link. the project is certainly worth a watch.  
but I would not like to have an extra overhead of taking care of installing  
java, instead now I am looking for ruby integrations with openoffice api's.  
Openoffice Api's have been integrated with Java and C++, but not with Ruby  
yet. Some discussions have happened before on ruby talk for providing this  
integration,  
[http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/92532](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/92532) .... but  
with no result :(.

On the way I came across, ooo4r which has not been updated for a while now.  
[http://rubyforge.org/projects/ooo4r/](http://rubyforge.org/projects/ooo4r/)

Has anyone worked with accessing/modifying/converting documents of  
openoffice programmatically from Ruby?

-Invincible

> **···**
>
> On 2/19/07, Hugh A. Cayless \<hcayless@lulu.com\> wrote:
> 
> > You might look at [http://www.artofsolving.com/opensource/jodconverter](http://www.artofsolving.com/opensource/jodconverter)  
> > which uses the OpenOffice API to run document conversions through  
> > it. I used it in a project last year, and it seems to work quite  
> > well on Linux. Since it runs as a web service, calling out to it  
> > from Ruby is straightforward.
> > 
> > Hugh
> > 
> > On Feb 19, 2007, at 8:29 AM, Invincible Code wrote:
> > 
> > \> I hope it works for Microsoft 2000 and onwards as well.  
> > \>  
> > \> btw I found a solution yesterday by using pdfcreator free utility  
> > \> which  
> > \> basically creats a virtual printer and lets me print my word  
> > \> doccument to  
> > \> the virtual printer which is nothing but a pdf target.  
> > \> However this appraoch has following limitations,  
> > \> 1. Works only on Windows machine.  
> > \>  
> > \> I am going to try out openoffice solution and see if it fits my needs.  
> > \>  
> > \> I appreciate all your help.  
> > \> Thanks  
> > \> Invincible  
> > \>  
> > \> On 2/19/07, Jason Mayer \<slamboy@gmail.com\> wrote:  
> > \>\>  
> > \>\> On 2/18/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > \>\> \>  
> > \>\> \> Aur, Thanks for the link!  
> > \>\> \>  
> > \>\> \> Regards  
> > \>\> \> Jatinder  
> > \>\> \>  
> > \>\> \> On 2/19/07, Invincible Code \<invincible.coder@gmail.com\> wrote:  
> > \>\> \> \>  
> > \>\> \> \> I have got through following,  
> > \>\> \> \>  
> > \>\> \> \> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/)  
> > \>\> 165458  
> > \>\> \> \>  
> > \>\> \> \> Was there any other thread as well?  
> > \>\> \> \>  
> > \>\> \> \> -Invincible.  
> > \>\> \> \>  
> > \>\> \> \> On 2/19/07, SonOfLilit \<sonoflilit@gmail.com\> wrote:  
> > \>\> \> \> \>  
> > \>\> \> \> \> I recall something VERY similar being discussed on the list  
> > \>\> a few  
> > \>\> days  
> > \>\> \> \> \> ago, have a search 🙂  
> > \>\> \>  
> > \>\>  
> > \>\> Ok, now that I've got a moment, here's an alternative using  
> > \>\> openoffice  
> > \>\> instead of MS Office. It's a nice printer friendly page as well.  
> > \>\>  
> > \>\> [http://www.xml.com/lpt/a/1638](http://www.xml.com/lpt/a/1638)  
> > \>\>  
> > \>\> apparently it works on .doc files made in office versions back  
> > \>\> through  
> > \>\> '97.  
> > \>\> I dunno if that'd be a better fit than the approach laid out by  
> > \>\> aur, but  
> > \>\> hey, I wanted to bring a real answer to the table 🙂  
> > \>\>
