Ghostscript Mfilemon Howto
Ghostscript Mfilemon Howto
http://www.lorenzomonti.it/
1. Introduction
Two years ago, I received a request by a customer of mine, asking for a program able to create PDFs out of
the invoices from his ERP. We had a batch procedure for invoice printing and a proprietary PDF printer
driver. The only way to go was to connect the PDF driver to the FILE: port, but then the user would have
been forced to input a name for each file. We were talking about hundreds of files at a time. After some
investigating, I decided to solve this problem writing a port monitor able to decide the file name for me. I
named it Mfilemon (Multi File Port Monitor) and gave it to the public domain, under the GPL license.
This document will guide you through the process of creating a PDF printer for Windows with the ability to
automatically choose the output filename, using only free software. This can be useful for "batch printing", for
example to produce PDFs out of an ERP's batch print procedure, or in any circumstances where an "ask for
filename dialog" would be uncomfortable or even unfeasible.
2. What's needed
Ghostscript (http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/current/)
Mfilemon (https://sourceforge.net/projects/mfilemon/files/)
Once you have downloaded the required software, follow the instructions given below.
3. Install Ghostscript
You will need to install Ghostscript. Please keep in mind where you install it to, since we'll require it later.
Click Next. You are asked for the name of the port:
Let's call it "GhostPDF:", following the Windows tradition of appending a colon to printer port names. You can
give it the name of your choice, though. Click Ok.
The configuration dialog for the newly created port is shown. Let's fill it:
Click Ok. The "Add printer" wizard shows a list of printer models:
Click on "Have disk", then "Browse", then go to the directory where Ghostscript was installed:
Enter the "lib" subdirectory, choose the file "ghostpdf.inf" and click Open, then Ok.
The following dialog appears, telling us that the file we choosed provides a printer named "Ghostscript PDF":
Choose the only available printer and click Next.
The wizard asks for a name for the printer (let's call it "Ghostscript PDF", "Auto PDF" or whatever name you
like), whether it should be the default printer or not, and so on.
These tasks are common to all printers, so if you ever installed one on your system you don't need step by
step instructions to finish this task. Only one note: during the copy of the driver files, Windows could
complain about the missing "Windows Logo" certification:
search for files whose name is like file0001-page*.jpg; if you find any, keep trying with the next
number: file0002-page*.jpg, file0003-page*.jpg, and so on, until you find one that is available;
then, generate a filename for Ghostscript, including the special tag %d.