# Printer Maintenance - Option 7

Contents of this section

Printer Maintenance Description

Entering Print Code Sequences

Escape Sequences

Decimal Control Codes

Hexadecimal Control Codes

Printer Routing

Copy and Modifying Printer Drivers

Advanced Concepts

Expert

Description:

Option 7 allows you to configure printers and to create printer drivers for use with filePro. filePro has pre-defined many of the printer drivers for you. These pre-defined drivers can be used as templates to create a new printer driver if your specific printer is not reflected in the list.

When you select the "Printer Maintenance" option "7", you will see a table similar to the following;

When pressing "S" - Select , a listbox of available printer tables is displayed. This presents a range of pre-defined printer drivers that you can modify or copy to a new printer driver name.

filePro accepts print code sequences in ASCII, decimal, and hexadecimal form. Control character combinations are also accepted. So you have maximum flexibility and can use whatever sequences you prefer. You can even mix these different forms in one print code sequence. Blank spaces are ignored but you may wish to use them in your sequences for clarity.

U - Update | Update the print code table currently loaded. Note: Print codes 1 and 2 cannot be changed.
S - Select | Selects a different table or define a new one.
C - Copy | Copies the current table of print codes to a new table or replace The print codes of an existing table with the current table.
F10 - Help | Displays help similar to what you are reading now.
D - Delete | Selects print code tables to delete.
P - Printer Maintenance | Goes to the Available Printers table to tell filePro what printers are available, which print code tables they use, and how they are connected to the computer.
H - Hardcopy | Prints the current print code table.
Number | The print code number.
Space | The number of printed spaces, if any (0-99), that the print code will take up when it is sent to the printer. For example, a "Horizontal line" symbol (code 45) will take up one space, While "Underline on" (code 5) wont take up any spaces. A Zero or a blank in this column means no spaces.
Sequence | The print code sequence, from your printer manual, for the print code desired. Help (with sequence syntax) can be retrieved by pressing F10 while you are updating a table.
Description | These are simply descriptions of what a print code entered here would be expected to do.

The first 54 code descriptions are pre-defined. For print code tables you create new or edit, you can fill in the number of spaces (if any) and the print code sequence that match the description. Print code descriptions can be either global or local. Global descriptions are the default descriptions that are predefined for every print code table. Local descriptions apply to the table in which they are defined. Whenever you edit a description, filePro asks whether the description should be saved as global or local. To edit a global description press F5.

Entering Print Code Sequences

filePro Plus accepts print code sequences in ASCII, decimal, and hexadecimal form (note examples below). Control-character combinations are also accepted. You can even mix these different forms in one print code sequence. The program ignores blank spaces, but you may wish to use them in your sequences for clarity.

# - Decimal | Type a pound sign (#) in front of each decimal number. Example: Epson FX, subscript on, is: #27 #83 #1
$ - Hexadecimal | If the number has an odd number of digits such as 0 or 1, add a zero to the beginning of number. Example: Epson FX, subscript on, is: $1b $53 $01 or (does not work in decimal): $1b5301
^ - Control Characters | Type a caret (^) in front of the character. The ESC Character in your printer manual can be entered as ^[.
%nn - Nested Sequences | Type a percent-sign (%) and the code number of the Code whose sequence you want to insert (nest) in. Another sequence. Example: Epson FX, you can Nest the sequence for code 5 in code 12 by typing: $1b M %5. Since the sequence for code 5 is "$1b - 1", you are entering the equivalent of: $1b M $1b - 1.
%name | Download a file to the printer "name" is the file to Send to the printer. Use with environmental variable PFDLDIR.
\\ - Literals | Type a backslash (\\) in front of a character to be Taken literally if it is ordinarily used for another Purpose by a print code table, as the $, #, and % Symbols are, for example. Example: If you needed to use the code "ESC-$", you would enter ^[\\$ rather than simply ^[$. \\$ tells filePro that the dollar-sign is a dollar-sign and not the flag for a hexadecimal number. Any other character will be interpreted as an ASCII literal.

Table Options

Type the codes shown in your printer manual following these rules.

Printer description | A description of the printer limited to 40 Characters.
Initialization print code number | The number of the print code, if any, that you Want to be sent to the printer before anything else.
Terminator print code number | The number of the print code, if any, that you Want to be sent to the printer after the output has been printed.
Graphic start print code number | The print code number at which the graphic sequences begin in the current table. On the default table the graphic sequences run from code 44 through code 54.
New-Line options | 1=CR/LF; 2=CR; 3 = LF; 4 = "\"LF. Enter the number 1,2, 3 or 4 for the kind of code that this printer requires to move to the beginning of the next line. Note: Code 4 was added in 5.0.9 to support the fP2RTF printer option.
Printer can form feed? (Y/N) | If the printer feeds a whole page of paper in response to the print code "$0c", then answer "Y", otherwise, "N".
Printer can backspace? (Y/N) | If you get a backspace in response to code "$08", then press "Y", otherwise press "N".
Page width | The maximum number of characters to print Across the page. (Usually, you will set this to either 80 or 132).
Page length | The length of the paper measured in printed lines. (For 8 ½" X 11" paper, you would set this to 66).
Print length | The number of lines to print per page. This no may be less than the page length and will give the page top and bottom margins.

Printer Routing

Configure printer routing with options by pressing "P" for Printers;

Printer Maintenance Options

Name | A unique phrase or number to help the users of the System identify the printer. The name can be up to sixteen characters and may not contain embedded blanks. Examples: printer3, joes, acctdept.
Type | The name of the print code table used by the printer. If youre not sure of the name, press F6 to select a name from a list of existing print code tables. This column must be filled in for each printer.
Destination File (Windows) | Type in the device name of the printer or a filename. If out leave the "Destination File" column blank, filePro will use the device name PRN". Examples: COM1, LPT1, PRN or a filename such as OUTPUT. Version 5.0 - Enhanced to use Window's printer spooling. Examples: WIN:LPT1, WIN:PRN, WIN:\\machine_name\printer_share_name.
Comment | You have a maximum of 80 characters for comments.
Destination (Linux/Unix) | Type in the command that the printer output will be sent to. Example: lp -dprintername -s where "printername" is the printer name that the operating system uses. If the line starts with a >, the rest of the line is the name of a file to send printer output. Examples: >/dev/lp01, >/tmp/output If the destination file is left blank, filePro will use a default print spooler command, typically: "lp -s".

Windows Spooling

Spooling for Native Windows filePro Windows doesn't spool print jobs, sent by native windows console applications to local printer ports, the same way that it does for MS-WINDOWS programs. (That is, open "lpt1" as a file and write to it.) We have added the necessary code to the native windows version of filePro to use the Windows printer routines (ie: OpenPrinter, StartDocPrinter, etc.) which do respect the Windows spooler. However, the spooler is also limited to those printers defined in the printer control panel. Therefore, we have made it a requirement that, in order to use the Windows spooler, you must prefix the filePro destination with "win:", as in "win:lpt1:". The rest of the destination must be the exact port name or printer name as you have defined it to Windows. So, if you have a printer attached to LPT1 that is named "HP DeskJet 870Cse", you would use either: win:lpt1: or win:HP DeskJet 870CseIf you have a network printer "\\server\printer" that is captured to LPT2,called "Bob's printer", and the Windows destination is "\\server\printer"then you would use either: win:\\server\printeror or win:Bob's printer. You could not use "win:lpt2:" as "lpt2" is not the destination that Windows knows the printer by. (Though you could use "lpt2" without the "win:" and go directly to that port without the spooler.)

Remember: You can only use the exact port name or printer name that Windows uses. Anything else will result in a "the parameter is incorrect" error when filePro tries to open the printer.

FP2RTF

The files in the fP2RTF install shield are used to setup filePro to print through Rich Text File (RTF) printer drivers. This provides the capability to print standard filePro reports with little or no modification in Rich Text format to "Windows Only" printers.

Prerequisites and Limitations

- fP2RTF is LIMITED for use with character-based filePro in the Windows environment and is NOT intended as a solution for graphic-based filePro e.g. fileProGI or *NIX systems' printing.

- filePro version 5.0.9 or later is required to use fP2RTF.

- Maximum Report Widths for 8.5" x 11" paper

- Portrait Printing:

10 pitch - 80 characters

12 pitch - 96 caharcaters

condensed - 132 characters

- Landscape Printing:

10 pitch - 100 characters

12 pitch - 120 characters

condensed - 168 characters

Environment

PFPOSTPRINT: The Rich Text drivers rely on pfpostprint being properly set. This variable should set in startup batch file for filePro.

PFPRTC: Identifies the Rich Text printer driver to be used. The RTF66 driver will allow you to print reliably for most applications and should be set in your startup batch file.

PFPRT: Identifies the output filename to use for fP2RTF. This variable is normally set by the "~\fp\fp2rtf\getname.bat" file.

Example

set pfpostprint=runbatch.bat

set PATH=%PFPROG%\fp\fp2rtf;%path%

set PFPRTC=rtf66

call %pfprog%\fp\fp2rtf\getname.bat

The above lines need to be in your startup batch file e.g. fpplus.bat to implement fP2RTF. This is automatically done for you if you have used the fP2RTF install shield and use a standard startup batch file name e.g." fpplus.bat", "hcfa.bat", etc. If you use a batch file with a name other than one of the standard batch file names, add the above lines near the end of your startup batch file and before the your the line that executes the p.exe menuname. Although you can set pfpostprint=Atlantis.exe, the above method is preferred since it will prevent sharing violations in a network environments and cleanup temporary files.

Atlantis Editor: Although other editor programs can potentially be used for viewing and printing the output, Atlantis should be used to ensure that the output is properly formatted and printed from filePro when using the filePro Rich Text drivers. Atlantis provides for proper margin and page control unlike other Rich Text editors/viewers.

fPfonts: fPtype1a.ttf and fPtype1b.ttf fonts have been specifically designed for fP2RTF.

Although other fonts can be potentially used, fP Technologies Inc. doesn't guarantee that they will be properly rendered or printed with fP2RTF.

Installation and Setup

Run setup.exe - This will install the fonts, make the fonts immediately available to Windows, will install the fP2RTF printer drivers and will create the reserved directories required for fP2RTF e.g. ~\fp\fp2RTF, ~\fp\fp2RTF\tmp.

Modify startup batch file - Modify your filePro startup batch file to include the following lines if it has not been automatically updated by the install shield.

set pfpostprint=runbatch.bat

set PATH=%PFPROG%\fp\fp2rtf;%path%

set PFPRTC=rtf66

call %pfprog%\fp\fp2rtf\getname.bat

Note: The above lines should be added near the end of your filePro startup batch file and after any other "set path=" line. "Sample.bat" is provided in the root of the source media as an example.

Note: File "~\fp\fp2rtf\Getname.bat" invokes the "RTF66.PRT" driver for development since filePro defaults to 66 lines for hardcopies created by "Define Files", "Define Processing", etc. You can change the "pfprtc" variable to use the "RTF60.PRT" driver for runtime applications if your dominant report format is 60 lines. Either driver can accommodate the less dominant report format by including the applicable print code in the report or as an initialization print code.

Add fP2RTF Printer line You should also add a printer line to your filePro configuration so that it can be selected when using the PQ printer flag. Use the "Printer Maintenance" option from the filePro Plus main menu, an then "P" for printers.

Examples:

Name Type Destination Comment

RTF66 RTF66 report.rtf To print 66 line RTF reports

RichTxt RTF60 report.rtf To print 60 line RTF reports

Troubleshooting fp2RTF

Reports run but are not displayed in the Atlantis viewer - This is due to the way some systems handle font registration. Although we have made every effort to make our fonts immediately available without restarting your system, rebooting is sometimes required to read the font locations from your system registry. If reports are not displayed after rebooting your system, contact the applicable technical support team.

%fpuser%%reportn%.rtf created instead of a report with the actual user name - You are running out of environment space so the required variables are not set. Increase your initial environment space by going to "icon properties" an then memory. Recommend setting initial environment to a value of "4096".

Another method for gaining environment space is to add a line near the beginning of your batch file used to start filePro e.g. "fpplus.bat". Add a line to shorten your path when running filePro. This will not affect other applications since the original path is restored when exiting filePro.

Example:

set path=c:\windows;c:\windows\command

Lines do not wrap properly - Reports are displayed but the lines do not wrap properly.

You are probably attempting to use an old version of filePro. Version 5.0.9 or later is required. Check your filePro path variables to make sure you are accessing the correct version of filePro.

Report Lines or Boxes are shown with dashes "-" and "+" - The fonts supplied with fP2RTF are either missing or not properly registered. Restart your system and then re-install the fP2RTF update. As a last resort, you can manually install the fonts using your control panel "fonts" option. This will install the fonts to your windows system directory. The fonts are available on the source media under directory ~/fp/fp2rtf as "fPtype1a.ttf" and "fPtype1b.ttf", etc.

Copy Print Code Example

Many printers use the same sequences to control common functions such as "Underline ON", Underline OFF", "Boldface ON", etc. You can quickly create a new printer driver by copying a generic printer driver like the EPSONFX (which applies to a narrow carriage printer like the EPSON Model FX80) to a table for your EPSON letter quality printer (like the EPSON LQ2550 132 column letter quality printer). Once the table is copied, you can modify the table by changing and adding sequences of codes to create a printer driver tailored to your specific printer model and then access the extended features for printing such as printing in letter quality mode and 132 column mode. For the sake discussion, we will copy the EPSONFX print driver in the list box to a new table labeled "LQ2550";

The above table contains "Escape Sequences" that are identical to the sequences required for the EPSON LQ2550 printer except for the added features pertaining to letter quality printing. The sequences are usually provided in the printer manual and referred to as "ESC Sequences" and "Control Codes". The following tables apply to the LQ2550 printer.

Notice that the sequences can be represented in 3 different ways in the above example i.e. ASCII (ESC Sequences), Dec (decimal values) and Hex (hexadecimal values). filePro provides the flexibility to use any of these representations as a sequence when defining the filePro printer driver.

After you have created the preliminary version of the new printer driver for the LQ2550, you can update the driver to add or modify print codes by pressing "U" for Update.

Tricks: Extend the number of defined printers from 9 (available in this maintenance editor) to as many as you need, by adding the additional printers in the filePro "config" file (found in the "fp/lib" directory). These printers must be added sequentially as printer10, printer11, printer12 and so forth. You can not skip a number in the sequence. If you do skip a number above printer10, that is as far as filePro will count, to the skipped number and no further. You will not be able to access the other printers.