Technical Information Database TI468D.txt - Printing in the TP/BP IDE Category :Printing Platform :All Product : Description: How to print from the Pascal Integrated Development Environment =============================================================== All printing is handled from the printer filter (prnfltr.exe) executable that is located in the bin directory. The source code for the prnfltr was included in both the Turbo Pascal 7.0 and the Borland Pascal 7.0 packages, although in different places. PRNFLTR.PAS if found in either the TPBIN directory or in the BPEXAMPLESUTILS directory. (Also look at the file LISTER.PAS in the BPEXAMPLESDOS or TPEXAMPLES. It is an excellent alternative to the standard printing options available in Borland Pascal.) From this file we can see the various printing options for PRNFLTR. The options can be changed from under File | Printer Setup | Command Line. The $NOSWAP does not change. For example, if changing from /EPSON support to /HP support, the command line should change from this: $NOSWAP /EPSON To this : $NOSWAP /HP Once the changes have been made to the command line for the PRNFLTR, be sure to save the current configuration (this will keep you from having to change the configuration every time you wish to print). The current configuration can be saved by choosing Option | Save menu option. OPTIONS FOR PRNFLTR =================== {************************************************} { } { Printer output filter example } { Copyright (c) 1992 by Borland International } { } {************************************************} The following printers are supported: EPSON and compatibles HP LaserJet II, III, IIP, IID, IIID, IIISi and compatibles (Italics are available on IIIx, IIP) ADOBE(R) PostScript(R) ASCII (simply strips the highlight codes before sending to Lst) Command line options: /EPSON - Output EPSON printer codes /HP - Output HP LaserJet codes /PS - Output PostScript /ASCII - Strip highlight codes (Default) /Lxx - Lines per page (Default 55) /Txx - Tabsize (Default 8) /O[file] - Output to file or device (Default LPT1) DEFAULT LPT1 ============ The default port for printing is lpt1. If you do not have your printer set up on lpt1 the way to change the default is by using the /O[file] option, replacing [file] with whatever port the printer is on (such as lpt2). Example (printing to an HP from lpt2): $NOSWAP /HP /Olpt2 PRINTING PROGRAM OUTPUT ======================= If you want to print the output of your program (i.e. what happens when the program is run) the document TI1255 will describe the process. "CANNOT FIND PRNFLTR" ===================== If you are getting the error prnfltr cannot be found, it can be solved by placing the BIN directory in the path statement of the AUTOEXEC.BAT. For example, if your AUTOEXEC.BAT's path statement says this: path=c:;c:dos;c:windows; The path statement should be changed to reflect the full path to the bin directory. Example: path=c:;c:dos;c:windows;c:bpbin; Then restart your machine and try again to print. *** PRINTING FROM A LASER (OR A LASERJET) PRINTER ============================================= If the file that you would like to print is less than a page long, sometimes it will be unable to print. The two possible solutions to this are as follows. 1) Put carriage returns into the document until it is more than a page long. 2) Also, placing a page feed character at the end of the document can sometimes solve the problem. To create a page feed character, press the control key and while holding it down press the P key. Keeping the control key pressed (still), then press the L key. (Recap: controlP L ). A symbol should appear on the screen where the cursor was. That is the page feed character. TROUBLE SHOOTING ================ If you have selected the option for the type of printer (or compatible printer) that you have and it is still not correctly printing, there are several possible things that could solve the error. The first thing that could solve the error is to run a "clean boot". Try a different option for the printer. From /HP and /Epson, switch to /ASCII. Also, disable the option "Send highlighting escape codes" (which appears just above the command line under File | Printer Setup) as well as using the /ASCII option could solve the problem. If you are still not able to print after trying several combinations of options, it is possible that your printer is not correctly set up to work from DOS. (If you are on a network it is also possible that your machine is not correctly configured to print to the network printer. Check with your network administrator to see if you are correctly connected.) To test for your printer setup, try printing straight from DOS. Printing from a word processor or from Windows is not comparable because those products provide their own drivers for printing. It is possible to print from DOS using copy or print. copy test.c lpt1 {if the printer is set up for lpt1} print test.c {if the printer is set up for lpt1} If neither of those commands works then it may be necessary to reconfigure your printer for printing from DOS before you will be able to print from the Pascal Integrated Development Environment. Reference: 3/31/99 10:11:34 AM
Last Modified: 01-DEC-99