Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I need to copy a .pdf file to a .doc file. Is this possible?? They are two different formats and I am not sure this can be done?

Should I use something like this on my NT???
use strict; use File::Copy; copy("file.pdf", "file.doc") or die "Cant copy PDF to DOC: $!";

Replies are listed 'Best First'.
Re: Copying file
by Abigail-II (Bishop) on Aug 15, 2002 at 11:33 UTC
    Well, that would certainly copy the file, but the format will not magically change because the filename has changed.

    You'd need a PDF to DOC translater. Did you check CPAN?

    Abigail

      I looked at CPAN and not sure where to search and find a module for PDF to DOC translater?
Re: Copying file
by helgi (Hermit) on Aug 15, 2002 at 13:27 UTC
    Copying file is certainly not a meaningful topic for your post. You do not simply want to copy the file, you want to convert PDF to Word format.

    Anyway, searching for PDF on CPAN turns up the PDF module which contains PDF::Core and PDF::Parse. These appear to be something you want. Whether they are complete I don't know. You will have to try it out.

    As for writing a Word file, the Win32::OLE module that comes standard with Activeperl can create a Word document and put stuff in it.

    The whole process is likely to be a medium size job, not just a matter of applying one simple function or copying a file.

    Regards,
    Helgi Briem