Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

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

by peterr (Scribe)
PDF NODE.owner = 295574 N.title = monktitlebar sitedoclet N.owner = 17342 -->
on Jan 24, 2004 at 00:37 UTC ( #323752=note: print w/replies, xml ) Need Help??

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

Hi Chris,

I make calls to external programs using IPC::Open3.

I had a look at that on Cpan and "open a process for reading, writing, and error handling" didn't mean much to me though, sorry I don't understand how I would use that.

Next I tried Anti-Word which is much faster and goes straight to text or to Postscript. I use it for the conversion to Postscript and then use ps2pdf to create the final PDF file. The documents come out perfectly.

Antiword is pretty small so in my spare time I've kind of been looking into ways it could be accessed directly from a Perl module. Not having much spare time or being very good at C has somewhat hindered that progress though :)

I have downloaded the *nix verion, but it looks like I'd need to compile all that in C, ... too much hassle and my brain hurts with that type of stuff. I'm downloading the 'Win' version, because it's a binary, and at a d/load speed of 0.2K/sec, it should be finished by tomorrow. You wouldn't be able to send me the *nix version of AntiWord' would you (please) ?


Replies are listed 'Best First'.
Antiword (Re: Converting M$ Word --> PDF)
by jonadab (Parson) on Jan 24, 2004 at 02:57 UTC
    I have downloaded the *nix verion, but it looks like I'd need to compile all that in C

    Only if you download the source (which is usually what you get if you go directly to the home page of a project, but that's not the usual way most folks install software). You can probably get an Antiword package for your Linux distribution. If you use an RPM-based distro, for example, check on Gentoo also has an ebuild for it (app-text/antiword), (though you're probably not using Gentoo if compiling C code gives you a headache). I can't speak for Debian-based distros with any degree of certitude, as I've not recently used any of those except Knoppix, but I suspect apt-get antiword might make you Bob's nephew there. (That's a guess. If it doesn't work, ask someone who uses Debian. Last time I used Debian apt didn't exist yet; there was only dselect.)

    $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
      Only if you download the source (which is usually what you get if you go directly to the home page of a project, but that's not the usual way most folks install software)

      From the "Linux" version here

      "The programmers' version does not contain any binaries, but the sources can be used to compile a Linux version. The sources can also be used to compile a version for most variations of the Unix operating system as well. Users have reported successful compilations on FreeBSD, Solaris, IRIX, Digital Unix (OSF/1), AIX, SCO and HP-UX"


        From the "Linux" version here

        Yeah, but what I was saying is you don't have to get it from there. You can probably get it from the same place you get the rest of your Linux distro, or from rpmfind or someplace like that. I can't be more specific without knowing which Linux distribution you're using.

        $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/
Re: Re: Re: Converting M$ Word --> PDF
by cfreak (Chaplain) on Jan 24, 2004 at 04:56 UTC

    No offense but the whole idea of Perlmonks is to learn, rather than getting people to do it for you. I don't mind answering questions, even about how to compile but don't give up so easily. Besides I'm on dial-up and it creates several files all of which I'd have to track down and send to you.

    Honestly its not that hard. If you open the readme file all you have to do (on Linux) is type 'make' and then 'make install' for a local installation in your home directory or 'make global_install' to install for the whole system as root. The later is probably what you want. If you aren't on Linux copy the appropriate 'Makefile.<your_os_name>' to just 'Makefile' and follow the same steps.

    As for the IPC::Open3 you don't have to use it, you can use system(), I just found that it gave me more control. See Advanced Perl Programming for some good examples on how to do it.

    Lobster Aliens Are attacking the world!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://323752]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2017-12-18 13:54 GMT
PDF NODE.owner = 295574 N.title = Sections sitedoclet N.owner = 17342 -->
PDF NODE.owner = 295574 N.title = Information sitedoclet N.owner = 17342 -->
Find Nodes?
PDF NODE.owner = 295574 N.title = Find Nodes sitedoclet N.owner = 17342 -->
    PDF NODE.owner = 295574 N.title = Leftovers sitedoclet N.owner = 17342 -->
    Voting Booth?
    What programming language do you hate the most?

    Results (486 votes). Check out past polls.