PRNSTR v. 1.5 by Brian Maxwell, (BEMAX@emn.com) based on previous version by Patrick Reilly, 70274,161 This code and concept is released into the public domain. This code works with Dos and TurboVision applications to provide printer support to Epson, HP Laserjet and PostScript Printers as streams. As originally designed by Patrick Reilly, this library just allowed for a single printer type, an HP Laserjet. I have modified it to work with other printers. The original idea for the prnbuf and stream framework belongs to Patrick Reilly. It was his idea of having separate printer objects descended from a common Class Printer which got me started. The printer stream library is designed to let you printer to common printers as you would write to a file or the screen. I have added support for Post Script printers and improved the Epson and HP Laserjet functions. The secret is in defining the prnbuf class which was done by Patrick Reilly, 70274,161 in version 1.0. The prnbuf class sends the characters out to the printer port designated in the constructor for the Printer Class. The Printer class is a virtual class used as a template for a specific printer class. From this, I have defined three specific printer classes for Epson, HP LaserJet and PostScript Printers. The PostScript printer class required that I modify the ostream class, so I derived the oprnstream class. I had to replace the sputn and sputc functions with new functions (putn & putbuf) that put the characters in the prnbuf buffer. The new functions check to see if the printer object is a PostScript Printer object. If it is and text to be printed is being processed, it encapsulates the text in parentheses which is required by PostScript. The PostScript printer initialization process downloads the header which defines macros for end of line, end of page, etc. This is still primitive but it works. There are manipulators for all printer objects which implement bold, italics and underline. Also there are manipulators for changing fonts and font size. As it stands now, you have a choice of three fonts : 0 -- Courier (non propotional) 1 -- Times Roman (Proportional Serif) 2 -- Universal (Proportional Sans Serif) It would not be difficult to add more for the HP and PostScript but the Epsons are pretty much limited to these fonts. For Font Size, you can supply the point size you want for the PostScript and HP printers, but for the Epson, you have to choose 0 -- 10 pitch 1 -- 12 pitch Installation: One note about installation. In order to create the new oprnstream class and make the manipulators work properly with other stream classes, I had to add a line or two to IOMANIP.H. I have included a file called IOMANIP.TXT which describes how to modify IOMANIP.H. You should follow the directions in the file for making modifications to IOMANIP.H. The IOMANIP.H file should be in your main Include directory (\BORLANDC\INCLUDE). IOMANIP will need to find a copy of prnstr.h so you should place it in \borlandc\include also. The oprnstr.cpp and .h files will need FAKEIEEE.H and IOCONFIG.H in order to compile. These files can be found in the \BORLANDC\CRTL\RTLINC directory. You may have to install the run time library files (RTL) if you did not do so when you installed your version of Borland C++. You can move these files to where you are compiling the prnstr files or you can make sure the directory is in your 'Directories' section of your options menu. The source code for the library is included so you can compile it for different memory models, etc. You will need to include the PRNSTR.H header in whatever program you are adding printer support to. You can see an example in TEST.CPP I would appreciate any feedback or criticism. I will be using and modifying this myself over the next few months, so your tips and suggestions are appreciated.