Next Previous Contents

7. Printing with TurboPrint

TurboPrint drivers are integrated into your Linux system in a completely compatible way (creating printer queues in /etc/printcap), so printing works just as with every other Linux printer driver.

7.1 Printing from shell

From the shell, files can be printed using the "lpr" command:

lpr -Pprintername file(s)

If CUPS is installed on your system, the following alternative print command exists (depending on the Linux distribution the "lpr" command is no longer available):

lp -d printername file(s)

Instead of printer name the short name of the printer must be entered, which is shown in TurboPrint's xtpsetup or xtpconfig setup or configuration tools. The default name for the first printer that is set up by TurboPrint is "tp0". So if you want to print a postscript file named "test.ps", just enter

lpr -Ptp0 test.ps

Another way is to use lpr is to put it at the end of a "pipe" - the output of one command is used as input from lpr. This is useful if a file is formated or converted first before it is sent to the printer.

Examples:

a2ps --output=- textfile.txt | lpr -Ptp0

An ASCII file is converted to a postscript file using the a2ps command. The output is printed by lpr.

For more information on lpr see its man page (man lpr).

Formatting ASCII documents

To print ASCII text files in a certain layout, you can call a2ps or enscript directly. Here are some examples:

a2ps --portrait --borders=0 --columns=1 --no-header --printer=tp0 myfile.txt
enscript --portrait --columns=1 --no-header --printer=tp0 myfile.txt
prints just the text - no borders, one column, no headers.

a2ps --landscape --borders=1 --columns=2 --printer=tp0 myfile.txt
enscript --landscape --borders --columns=2 --printer=tp0 myfile.txt
prints the text in landscape orientation with borders, two columns per page with headers (filename, page numbers).

For more information on a2ps and enscript see the man pages (man a2ps, man enscript).

What file types can be printed?

Many common file types like postscript documents, plain ASCII files or JPG images are automatically recognized by TurboPrint and can be printed directly from command line.

Responsible for correctly discerning the file type is the TurboPrint printer filter, "tpfilter". It uses the shell command "file" for recognizing the MIME file type.

Please have a look at the tpfilter man page to see which file types are currently supported and which commands are used for file conversion (man tpfilter).

If a file format is not supported by tpfilter (like some image formats) it must be converted first.

7.2 Printing from applications

Internally, printing from an application looks just like printing from shell: The application programs creates a temporary file with the page(s) that should be printed (usually in postscript format) and starts the lpr command.

In most applications the user can determine whether another print command should be used instead of lpr and which parameters should be used for it (e.g. -Ptp0 to choose a certain printer).

Some applications also show a list of all printer queues on the system. Simply select your printer in this list.

kde print dialog

Note: for every printer queue set up by TurboPrint, also a "raw" queue is created (e.g. "Epson_StylusColor680raw"). This is normally used to print from other computers on a network. Don't choose this raw queue.

Gimp

Click on the image to be printed with the right mouse button, then choose "File -> Print...". In the frame "Printer Settings", button "Printer" choose the short name of your printer. Set "Media Size" to the desired paper size.

gimp - print dialog

Then click on the "Setup" button.

gimp - setup dialog

Choose "PostScript Level 2" as the printer driver. Dont choose any of the manufacturer specific drivers (Epson / HP / ...)! The default in the field command must be slightly changed. Please remove the "-oraw" option. The correct entry is:

lp -s -dprintername

For older versions of GIMP the command line must be changed from "/usr/bin/lpr -Pprintername -l" to

/usr/bin/lpr -Pprintername

The field "PPD File" can be left empty. Only if you're using the CUPS printing system should choose the PPD file for your printer from the directory

/usr/share/cups/model/turboprint

Press "OK" to close the "Setup" dialog.

As GIMP prints the picture a bit too bright you should open the Dialog "Adjust Colors" and change the "Gamma" setting to 0.55. At this point everything is set up correctly for TurboPrint.

Now you can choose the print size and position of the image. Use the "Scaling" slider to change the picture size. The print position can be changed either by moving the black square in the preview or by entering the position in the fields "Left" and "Top". Use "Center Image" to position the image in the middle of the page.

Finally choose "Print" or "Print And Save Settings" to print the picture or just "Save Settings" to save the settings you made.

Netscape

The print dialog can be opened with the "File" menu, option "Print...".

For use with TurboPrint, choose

Print To: Printer
Print Command: lpr -Pprintername

The other settings in the dialog can be set as needed. Just make sure to select the correct paper size.

StarOffice

Setup

Before you can print, you must first setup one or several printers.

StarOffice - Desktop

Click on "Printer Setup" on the StarOffice desktop.

StarOffice - Setup Dialog

Select "Generic Printer" on the list of available printer drivers. Then choose "Add new printer" - a new entry will appear in the list of installed printers.

If you are using the CUPS printing system you should add a new printer driver instead of using the generic printer driver. Choose "Install new driver" and enter the path to the CUPS PPD files ("Driver Directory - Browse"). The path is by default

/usr/share/cups/model/turboprint

Choose the correct printer and click on the "Ok" button. Now the new printer will appear in the list of StarOffice printer drivers. Choose it again in the printer driver list and choose "Add new printer" - a new entry will appear in the list of installed printers.

Choose "Connect..." to open the following dialog:

StarOffice - Printer Connect Dialog

Select the printer queue of your choice (e.g. "tp0") and close the dialog with "OK".

Now open the "Configure" dialog with the button "Configure..."

StarOffice - Printer Configure Dialog

Choose the default page size and orientation. Then set "PostScript Level"="2" and "Color space"="Color". If you're using the CUPS printing system, you also have to choose the print resolution (DPI). Close the dialog with "OK".

Finally, you can change the printer name with "Rename". Now close the "Printer Setup" dialog - everything is set up.

Printing

Open the "Print" dialog with the menu "File" / "Print".

StarOffice - Print Dialog

Choose your printer. In the "Properties..." dialog you can change the page size and the color mode, if you want to. With the CUPS printing system you can also change settings like print resolution and print media. Thats it! Just press "OK" to print.

Note: The printout may need much time to process if you have chosen "TrueColor" mode in TurboPrint's xtpconfig configuration menu. You can speed up the printout a lot by choosing "Black & White". Also with the "256 color" or "Grayscale" modes printing speed will be a bit higher.

KDE Applications

Most KDE applications use a standard print dialog.

The available printers are listed with their long (left column) and short names (right name). You only need to select your printer and make sure that the correct paper size is chosen.

7.3 Network Printing

Printing to a printer server

If you use TurboPrint, the conversion from the document or image format (e.g. Postscript, PPM, ...) to the printer command language (e.g. ESC/P or PCL) will always be done on the local workstation (where the "lpr" command has been issued).

This means that on the printer server, a printer queue without any further conversion or "filtering" must exist. If TurboPrint is used to create printer queues on the printer server, it will automatically create such "raw printer queues" for access from client computers. These are named like the normal printer queues plus the ending "raw". For example, if the short name of a TurboPrint configuration is called "tp0", the raw printer queue is named "tp0raw".

This raw printer queue must be chosen in xtpsetup on the client computer.

Example for the configuration of a network printer in xtpsetup (the printer server is named "printerserver", the raw printer queue on the server is "tp0raw"):

xtpsetup - remote printer configuration

If the printer server is a windows computer accessed via SAMBA, it will always interpret the data as "raw". Example for the configuration of a windows network printer in xtpsetup (the printer server is named "windowspc", the printer on the server has been shared using the name "hp":

xtpsetup - remote windows printer configuration

Printing from a windows computer

If you want to share a printer that is connected to your Linux workstation to a windows computer, the SAMBA package must be installed and running. In the SAMBA configuration file, the printer queue must be made accessible for access from the network.

Which printer driver should be chosen on the windows computer? There are two general possibilities:

  1. The correct driver for the printer is used on the windows computer. On the Linux computer, the data must just be passed on to the printer without any further modification. To achieve this, the "raw" queue must be chosen, e.g. tp0raw

    If the CUPS printing system is installed on your Linux computer print jobs that come from a Windows computer are by default sent to the printer without changes.

    It that doesn't work on your installation, you have to edit the configuration file

    /etc/smb.conf
    

    on your Linux computer. In the section for the printer the line

    print command = lpr -l -r -P%d %s
    

    must be added (or modified, if the entry "print command" already exists). Thus print commands from Windows will be interpreted as "raw".

  2. A generic postscript driver is used on the windows computer. Now TurboPrint will be used on the Linux computer to process the data. Just use the normal printer queue, e.g. tp0. If the CUPS printing system is installed on your Linux computer you have to edit the configuration file
    /etc/smb.conf
    
    on your Linux computer. In the section for the printer the line
    print command = lpr -r -P%d %s
    
    must be added (or modified, if the entry "print command" already exists). Thus print commands from Windows will be interpreted as postscript.

Next Previous Contents