Office2pdf was created within the framework of the LLL project, whose goal is to equip all schools with Linux servers (which act as fileserver, printserver, primary domain controller, firewall, squid web proxy, etc...).

It saddened the LLL team to see that many teachers still communicated exclusively via Word and Excel documents, thus inconveniencing those few teachers that preferred to move on to a free platform.

Office2pdf's goal is twofold:

Hence the decision to set up an office to PDF converter was taken. Initial plans were to provide a public access samba print server to which people could just print their Word documents. We do already use similar schemes within the LLL schools. However, for home use, this was judged impractical, because it was beyond most users' knowledge how to set up their Windows boxes to print to our samba server.

Hence the idea to set up a mail based system. A small web search revealed a couple of projects, however none was 100% suitable for us:

Thus, the conclusion was to roll our own.

How does office2pdf work?

As soon as a mail comes in, it is unpacked into a spool directory by the unpacker.pl script, which is activated via the office2pdf user's .forward file.

A worker program periodically polls the spool directory, and as soon as it sees a new job, it spawns (using wine) a Word or Excel viewer process. The worker interacts as a controlling agent with the viewer using the xte package (to send mouse and keyboard events), and the xwininfo utility (to see watch which viewer windows are up). The wine process displays to a virtual screen (implemented either using Xvnc or Xvfb). Using these tools, the worker instructs the viewer to "print" the document to a postscript file.

Once the postscript file is finished, it is converted to pdf by the ps2pdf utility.

As a last step, the worker packages all pdf files together into a MIME message, and sends it back to the user

Using a virtual screen allows us to keep the physical screen free for other uses. Hence, you do not need to set aside a machine for exclusive use by office2pdf.

Installing office2pdf

Installation is covered in much more detail by the office2pdf Installation page. If you are trying to install Office2pdf 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.

Pick a Linux machine where you want to install the software on, prerferably SuSE. Make sure wine is installed on the machine. Download the support software (xte, MIME::Parser perl module, ...), the free Microsoft Office viewers, the windows fonts, and instal the whole shebang. Installation is unfortunately somewhat lengthy due to the number of support softwares to install (it takes about half an our to walk through the install script), in one of the next versions I might supply an automated install script.

Although SuSE is preferred, office2pdf should be able to work on all distributions. However, in that case some tweaking may be needed (for example, the /etc/init.d/office2pdf script might need some adaptation)

Once everything is installed, you can start office2pdf with /etc/init.d/office2pdf start, and activate it permanently with chkconfig --add office2pdf so that it starts automatically after a reboot.

Experienced users may want to tweak the office2pdf.cfg file to add support for new viewers, to use different X servers, change the timings, etc. Currently, there is no html documentation yet about configuration, but the office2pdf.cfg file itself is versbously commented.

Valid HTML 4.01!

Alain Knaff
Last modified: Fri Jul 23 19:38:48 CEST 2004