Doc2pdf was created primariily because I personally hate getting Microsoft Office attachment in my email. Do people actually think that everyone can view and print those things? As a Linux/Unix developer, I seldom if ever touch a Windows machine so it is a real pain to have to find someone in marketing or product management that actually runs Windows and have them print documents for me. Besides, there are times when I'd love to keep around an electronic copy of certain documents that are too long (or change too often) to print.
Eventually, I decided that others might have the same problem, so one night, I decided to write Doc2pdf. It turns out that there were enough people interested in Doc2pdf at work that we eventually set it up for the whole company to use.
Doc2pdf periodically polls a designated POP3 mailbox and replies to all recipients of email messages that have Microsoft Office attachmentes. Doc2pdf uses POP3 to download email messages and saves all attachments to a spool directory. It then uses Microsoft's own viewers to render and print Microsoft Office documents as PostScript files. These PostScript files are converted to PDF format using AFPL PostScript for Windows, reattached to the original message, and sent to all recipients of the original email using SMTP. Simple but very effective.
Doc2pdf's job in all this is to act as the controlling agent (or robot). You can get more information by looking at the code, but basically Doc2pdf consists of a rudimentary POP3 client, MIME email parser, Microsoft viewer controler, and SMTP mailer.
There are a few drawbacks to the way that Doc2pdf is currently implemented -- most of them are tradeoff that result in a peice of software that can be completely functional with out requiring any expensive comercial software. The main drawback is that Doc2pdf controls the Microsoft viewers using a journal playback hook. It is actually kind of cool to watch Doc2pdf run because you can see the Microsoft viewers running as if a user was controlling them. The problem, though, is that it kinda dominates the machine it is running on and limits it to being a Doc2pdf robot only.
In my college years, I wrote my share of Windows programs, but as mentioned earlier, I am primarily a Linux/Unix programmer. Therefore, I recognize that there might be a way to use the Microsoft viewers that would less obtrusive to the host machine. However, I have looked fairly hard to find a way to reuse the OLE components shipped with the viewers, but they all appear to be disabled for normal use. There is, however a very easy way to make Doc2pdf work with the components that are shipped with Microsoft Office. The problem with this is that Microsoft Office costs money.
If you already have a Micosoft Office license, then you'll be happy to know that I am thinking about enhancing Doc2pdf so that there will be an option to use already installed Office components. When using embedded Microsoft Office components Doc2pdf would be completely unobtrusive to the host machine and would most likely run as a service. If you are interested in helping out with this enhancement, please send me email.
Installation is covered in much more detail by the Doc2pdf Installation page. If you are trying to install Doc2pdf you should stop now and read the installation page. If you are looking for an overview fo the installation process, you can read the next paragraph.
Find an unused low-end Windows machine -- not a very difficult task in most organizations. Download and install the free Microsoft Office viewers (see the download page or installation page for links). Download and install AFPL PostScript for Windows (links also found the download page or installation page ). Set up a "print-to-file" printer using any PostScript enabled print driver. Set this printer as your default printer. Install the Doc2pdf application. Run the Doc2pdf application . Click the setup button and supply the run-time and mailbox information. Press the start button and leave the Doc2pdf machine alone.
Press the "Start" button to start Doc2pdf working, The first thing Doc2pdf will do is poll the POP3 mailbox for messages. If no messages are waiting, Doc2pdf will sit idle for a couple minutes before polling again. As mentioned previously, Doc2pdf should not be disturbed while it is working (downloading, converting, or sending email) Clicking around the desktop with the mouse can change the input focus in ways that will screw up Doc2pdf to the pint that it will have to be restarted. I can not emphasize this point enough. DO NOT touch Doc2pdf unless the status display shows "Idle" or "Stopped". If the status display says "Idle" then you can click "Stop" to stop Doc2pdf operation.