Win4Lin User's Guide

About Printer Device Definition

Win4Lin sessions can print either through the Linux printing system or by directly attaching to a parallel port that has a printer connected.

This "Printer" view of the Device Definition window is used to work with printer definitions for printing through the Linux printing system. You can view, modify, or delete existing definitions or create new ones.

To work with device definitions for directly attaching parallel ports, use the "Custom" view instead of this "Printer" view.

Note: To modify, create or delete definitions you must be running with "root" privileges.

For more information about the general subject of device definitions and managing them, see ``About Device Definition''.

Linux Printer Definition

To set up your Linux printer to be available to Win4Lin sessions, you first need to configure the printer under Linux, then create a Win4Lin printer definition, and then attach it to your Win4Lin session. Attaching the printer to a DOS session is done much differently than to a Windows session. For DOS you print via a redirected LPT port that you set up in your "Personal Win4Lin Session Configuration". For Windows you don't do anything with LPT ports in your session configuration, you just use the normal Windows "Add Printer" utility from within your Windows session. Refer to the topic `` Printing through the Linux printing system'' in chapter 4 of the Win4Lin User's Guide for more information.

Win4Lin provides one standard printer definition, named default, which prints to the default Linux printer.

Printing via the Linux printer is done by Win4Lin executing the Linux command that is specified in the Printer Command setting. You may update this command as needed to get proper printing output.

If you have multiple printers or need to have multiple ways to print to a single physical printer, you need to create new printer definitions. Once you create a new printer definition, it automatically becomes available in the Windows "Add Printer" utility. And for printing from DOS, it appears in the Personal Win4Lin Session Configuration window as a selection for LPT attachment.


Determining the printer command

Before you can create a new printer definition (or update an existing one) you first need to determine the Linux command that is required to actually do the printing of the data from your Window or DOS program.

The type of command is the one you would use to print from the Linux command line (for example, lp -dprintername) when the data to be printed is fed in via "standard in". It can also be any other Linux command that will operate on standard input. For example, you can run your printer output through a filter before printing by using the following command: "filtername | lp -dprintername". Another example is a command that just saves the output to a file: "cat > $HOME/print.out".

Refer to the topic `` Printing through the Linux printing system'' in chapter 4 of the Win4Lin User's Guide for more information about how to determine the correct command.


Creating a New Printer Definition

Once you have the command needed to print via a Linux printer, you can follow these steps to create a definition for that Linux printer:

  1. Click on the New button to create a new token name for the printer. Type in a new token name you want to use for this new definition, and then click the OK button. Alternatively, you can select an existing printer definition (e.g., default) from the list of tokens, modify the settings appropriately, and then save the resulting definition under a new token name.

  2. Enter a description for the printer in the Description text box. The text in this box will appear as the entry in the Windows "Add Printer" utility, and in the DOS Printer LPT1, LPT2, or LPT3 selection lists in the Personal Win4Lin Session Configuration window. Therefore, this text should be descriptive enough to identify the printer, but short enough to fit in the selection list field, which has limited width.

  3. Specify the appropriate Usable By setting. See ``About Device Definition'' if you need an explanation of the appropriate setting for this field.

  4. In the Printer Command text box, type the Linux command that sends the output to the appropriate printer.

  5. Click on the Save or Save As button to save the new printer definition.