PrintFilePrinter for Windows

A utility that prints or creates PDF files from legacy printfiles

PrintFilePrinter is a utility that watches a specified folder for printer output files and either sends them to a printer or converts them to PDF format. It may be useful for DOS and 16-bit Windows applications that cannot communicate directly with current Windows printers. It also provides features that make it possible for DOS applications to exchange data with the Windows clipboard. It may be especially useful with DOSBox or DOSBox-X or with 16-bit applications running under otvdm/winevdm. It is not useful or necessary with vDos, or with the vDosWP or DOSBoxWP systems, which have most of its features already built-in. It may be useful in Windows 10; if so, see the notes below on how to create a print-to-file printer in Windows 10.

You may download the PrintFilePrinter installer here.

During installation, you will be prompted for a directory to watch (typically C:\TEMP) and a default page size (US Letter, Legal, A4). By default, if you use the program's feature that saves a printfile to a PDF, the PDF will be created on the desktop; the installer will ask if you prefer to use a different folder instead. You may also choose an option to run the program when Windows starts up.

The program is a compiled AutoIt script, and your antivirus software will probably warn you against using it. If you don't trust my software, don't use my software. Please do not waste your extremely valuable time writing me an e-mail informing me that your anti-virus program has flagged this software, or asking whether the software is safe.

You may download the AutoIt source code here (it includes irrelevant code taken from some of my other projects).

While this program is running, it continually watches the selected directory (typically C:\TEMP) for newly-created files with these extensions:

I strongly recommend that you do not set the program up to watch a directory containing documents or other files that you want to keep, because this program deletes printfiles (and some files named *.TMP) without warning. So please, when installing this program, designate a watched folder where you do not keep any documents or other files that you want to keep.

You can set up your DOS or 16-bit software to "print" to a file named (for example) C:\TEMP\OUTPUT.PRN and PrintFilePrinter will try to print it to your default Windows printer. It works this way:

If the printfile is named <anything>.RAW, the program will send the data in the file directly to your Windows default printer. If your Windows default printer is compatible with the data, then the data will print. Otherwise, either nothing will happen or you will waste a lot of paper.

If the printfile is named SELECT.RAW, the program will pop up a list of available printers, and you can choose the one to which the program will send the data. Again, the printer will need to be compatible with the data, or nothing will print.

If the printfile is named <anything>.PCL, the program assumes that the file is in fact PCL code; it uses GhostPCL to convert it to a PDF file, and then uses my PDFtoPrinter utility to send the PDF to the default Windows printer.

If the printfile is named SELECT.PCL, the program will pop up a list of available printers, then convert the PCL to a PDF file, and send the PDF to the selected printer.

If the printfile is named PDF<anything except TEMP>.PCL, the program will convert it to a sequentially-numbered PDF file on the Windows Desktop and open the PDF. (If you chose a different folder during installation, the program will save to that folder instead.) See another section of this page for more information on the save-to-PDF feature.

 If the printfile is named PDFTEMP<anything>.PCL, then the program will create the PDF in your Windows temporary folder (%TEMP%) and open it for viewing, printing, or saving. This means that you can use output filenames like PDFTEMP2.PCL or PDFTEMP-LadyGaga.PCL and the effect will be the same.

Similarly wth PostScript files. Name the printfile <anything>.PS, SELECT.PS, or PDF<anything except TEMP>.PS or PDFTEMP<anything>.PS, and the program will assume that the data is in fact PostScript code, and will perform the same actions as it does for PCL files, but using GhostScript to convert the PostScript data to PDF. See another section of this page for more information on the save-to-PDF feature.

Similarly with Epson Esc/P files. Name the print <anything>.ESC, SELECT.ESC, or PDF.ESC or PDFTEMP<anything>.ESC, and the progam will perform the same actions as it does for PCL and PS files, using DOSPrinter to convert the Epson Esc/P data to PDF. (If you do not register DOSPrinter with its author, it will print a watermark on some output files.) See another section of this page for more information on the save-to-PDF feature.

If the printfile is named <anything>.PRN, SELECT.PRN, or PDF.PRN or PDFTEMP<anything>.PRN, the program will try to determine if it is PCL, PostScript, Epson Esc/P, or some other kind of code. If it is not PCL, PostScript, or Epson Esc/P, the program will attempt to convert or print it as text, using the freeware Txt2PDF.exe for text conversion. See another section of this page for more information on the save-to-PDF feature.

If, for example, you have chosen US Letter as the default page size, you can force the program to print or convert to Legal size by adding LG immediately before the file extension, as in SELECTLG.PCL. (This does not apply to .RAW files.) You can specify A4 with something like <anything>A4.PCL or US Letter (if it is not the default with <anything>US.PCL. This option applies to the printfiles with the extensions PCL, PS, ESC, and PRN, not to RAW.

If your old DOS application is hard-wired to print to a four-letter port name like LPT1, then do the following. Choose a driver letter not otherwise used in your DOSBox or DOSBox-X setup, perhaps P: which will remind you that that drive letter is used for the Printer output. Patch your DOS application, replacing the string LPT1 with  the string P:\@ so that your application "prints" to a file named "@" (no quotation marks) in drive P:\. If you are running the application under DOSBox or DOSBox-X, then, in the emulator, mount C:\TEMP (or whatever folder that the PrintFilePrinter program is watching) as drive P: so that any file printed from your emulator to P:\@ will be written to the C:\TEMP folder as a file named "@" (no quotation marks). PrintFilePrinter will print a file named "@" in the same way that it prints files named <anything>.PRN - that is, it will test the file to determine if it uses PCL, PostScript, or Epson Esc/P format, and the print it using the method that the program uses for the relevant format; or, if the file is not in any of those formats, the PrintFilePrinter will print the file as plain text.

Note: Using the method described in the preceding paragraph, you can also set the PrintFilePrinter so that it will select a printer when you print from an old DOS application. To do this, patch the port name in your DOS application to P:\% so that the select-printer dialog will appear when you print. Or the PrintFilePrinter program can create a PDF on the desktop; do this by patching the port name in your DOS application to P:# so that any file printed to that name from your emulator will cause an arbitrarily-named PDF file to be created on your Windows desktop.

If you want to specify the name and path of the PDF file created by this program, have your DOS or 16-bit Windows application write the full path of the desired output file in a text file, which must be saved with the name PDFNAME.TMP in the watched folder (typically C:\TEMP). This file must be created before your application prints the printer output file that you want to convert to this named PDF. Typically, a macro (in WordPerfect, XyWrite, etc.) can create this text file and then print to the printfile. (The PDFNAME.TMP file will be deleted after the PrintFilePrinter program reads it and gets the name that it will use for the output PDF file.) If a PDF file with the selected name already exists, you will be prompted to overwrite it or cancel file creation.

While the program is running, you can click on its tray icon for information on its options (and the current watched folder and default page size), or to exit the program.

Clipboard support

This system also supports text exchange to and from the Windows clipboard. If you "print" a file named CLIPOUT.TMP to the watched folder, the contents of that file will be copied to the Windows clipboard (any closing carriage-return-line-feed will be removed). If your file is not pure ASCII, then "print" a file named either CLIP437.TMP (for DOS programs running in codepage 437), CLIP850.TMP (for DOS programs running in codepage 850 or 858) or CLIP1252.TMP (for output from 16-bit Windows programs).

You can also "print" a file that tells this system to save the Windows clipboard to a file, so that your application can open that file and get the contents of the clipboard. The file to print to the watched folder should be named GETCLIP.TMP (it can be empty or not; the contents don't matter); a file named SENDCLIP.TXT will be created in the watched folder, containing the contents of the Windows clipboard.

About the save-to-PDF feature

If the name of your output printfile is PDF*.PCL (or PDF*.PS or PDF*.PRN, etc., but not PDFTEMP.*) then the program, by default, will save a PDF to your Windows desktop with a sequentially numbered name in the form File0000.pdf. If you specified a different save-to-PDF folder during installation, then the program will use that folder instead of your desktop.

You can control the name of the saved PDF by setting your output printfile to be named something like PDF-XY.PCL. If you do this, then the saved PDF will be named XY0000.PDF. The characters that precede the number in the PDF filename will be the characters that follow "PDF-" in the printfile filename.

 How to create a print-to-file printer in Windows 10

It may be useful to have a Windows printer driver that creates and displays a temporary PDF file that you can print or save or abandon. Use this method to create a driver that sends PostScript output to the PrintFilePrinter system described above:

With PrintFilePrinter running, you can "print" to this Windows printer and a PDF file will open in your default PDF application.

You may also use any Windows PCL printer driver that works smoothly with your 16-bit application; replace .PS in the instructions above with .PCL.

To use Microsoft's "Generic Color PostScript Driver for Commerical Printing" printer driver (which was distributed with many older versions of Microsoft Office Professional), download this .zip archive, extract it to your desktop, and then perform the steps above, with this exception:

Edward Mendelson (em thirty-six [at] columbia [dot] edu, but with two initials and two numerals before the [at] sign, not spelled out as shown here).