Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Converting M$ Word --> PDF

by peterr (Scribe)
on Jan 23, 2004 at 23:43 UTC ( #323736=note: print w/ replies, xml ) Need Help??


in reply to Re: Converting M$ Word --> PDF
in thread Converting M$ Word --> PDF

Hi neuroball,

Download OpenOffice for whatever OS you would like to use and install it

Okay, I only have Win95, so the 1.0.x version is the only one I can install.

Go to the ooolib web site on sourceforge and download/install it. This will make OpenOffice's API accessible to perl.

Okay, will do. :)

In OpenOffice you can "Print to File" and set the filetype to "PDF". You just have to find out how to access this functions from the ooolib level.

Okay, I don't know how this all fits together with Perl (because I noticed 'ooolib' is a Perl library). No doubt OpenOffice must spawn a Perl process, I don't know ??

Btw. OpenOffice does automatically open Word files

I do have Word 2000, as part of Office Developer 2000 suite, but I can see it will not help me, but your solution will. The reason I need to do this is everytime a client wants me to update his catalogue on the website, I can change it in Word, but there is also a PDF catalog on the website, which of course also needs updating. He (the client) has the tools (Adobe) to convert the new catalog from Word --> PDF, but I don't. I usually have to ask him 10 to 15 times to convert it, even though it's a 5 min job. So, this gets rather a pain in the ..., after a while, and I would ideally like to do this:

1. Have the 'catalog' on the website in HTML format.
2. Use Perl to convert to PDF
3. Use Perl to convert to Word

I know I have seen a Perl module to do step 2, don't know if there is a Perl module to go HTML --> PDF though.

Thanks, :)

Peter


Comment on Re: Re: Converting M$ Word --> PDF
Re: Re: Re: Converting M$ Word --> PDF
by neuroball (Pilgrim) on Jan 24, 2004 at 00:51 UTC

    Peter, you can just use the above concept also to covert from HTML to PDF. I have no idea where the limits are though.

    Just use perl to open the HTML file in OpenOffice and then make OpenOffice print it to PDF. I just tried it with a google page, and as long as the images are local, no problems should arise.

    If you want another way you might try the following:

    • Download HTMLdoc, which is GPL'ed, and install it.
    • Download HTML::HTMLdoc from CPAN and install it.
      1. Do some perl magic to get what you want...
      2. ...Unknown step...
      3. Profit!

    /oliver/

      Hi neuroball,

      you can just use the above concept also to covert from HTML to PDF. I have no idea where the limits are though.

      Yes, I think I saw a module on Cpan to do it. Now, if there was also a Perl module to do HTML --> Word, that would be great.

      Just use Perl to open the HTML file in OpenOffice and then make OpenOffice print it to PDF. I just tried it with a google page, and as long as the images are local, no problems should arise.

      Okay, I will try that, seeing I have just d/loaded OpenOffice, all 52 Mb. Hope it handles tables, word templates, images,etc, okay

      If you want another way you might try the following:

      • Download HTMLdoc, which is GPL'ed, and install it.
      • Download HTML::HTMLdoc from CPAN and install it.
        1. Do some perl magic to get what you want...
        2. ...Unknown step...
        3. Profit!

      Okay, I will try that also. Wow, I sure have enough things to try now, thanks everyone for your help. :)

      Peter

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://323736]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2014-12-29 14:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (191 votes), past polls