Previous Table of Contents Next



Reading and writing Excel documents is great. Is there a way to read and write Microsoft Word documents?


Not directly. First, you can use Object Linking and Embedding (OLE) to remotely control a running copy of Microsoft Word to load a document and retrieve the information you need. Of course, this only works on Windows systems with Word installed, and you'll need the OLE::Win32 module. The module documentation has examples of how to do this.

The other approach is to use a common document format between Word and your programs. The most common is Rich Text Format. Microsoft Word can load and save RTF documents and there are Perl modules for reading and writing RTF documents.


How can I put images in my PDF documents?


The document object has methods for creating images (image_jpeg, image_gif, and so on) and the graphics handle has a method for placing that image on a page (gfx->image). You can also rotate, skew, and create many kinds of effects for images and text. See the PDF::API2, PDF::API2:Text, and PDF::API2::Gfx manual pages for details.


The web site I'm trying to retrieve information from requires login information to be sent. Can I use LWP::Simple for that?


Probably not. As your web requests get more and more complex and include cookies, encryption, and HTTP header manipulation, you're going to need the more completebut complexset of LWP modules (LWP::UserAgent, HTTP::Cookies, HTTP::Request, WWW::Mechanize, and so on). If you're going to do this regularly, I recommend the book Perl & LWP by Sean Burke.

    Previous Table of Contents Next
    © 2000- NIV