How to Set the Virtual Printer Tabs


Contents

About this document
Problem
Cause
Solution

About this document

Frequently when you create a text document, you separate columns with tabs. When you print this file through the virtual printer, it changes those tab characters to spaces before sending it to the virtual printer. Often the output on the printed page does not line up as it did when you viewed the text in your editor. This document describes how the tab stop replacement works in the AIX virtual printer. With the help of this knowledge, you can customize the virtual printer to get the columns of text to line up again.

This document applies at all levels of AIX.


Problem

You are changing your tab stop to 12 characters in vi and you want to print the file with this change.

You would like your file to look like this:

12345678901234567890
Column one Column 2

But the virtual printer may print this like:

123456789012345678901234567890
Column one      Column 2


Cause


Things can really get much worse. The virtual printer turns the tabs into spaces and this is controlled by the wh attribute.


Solution

Change the tab settings in the virtual printer to add the tabs where you want them. This can easily be done with the lsvirprt command as follows:

This will put you in a vi session to edit the wh attribute, and the screen will look like this:

The constant 9 is the variable for the first tab column, and the constant 8 is the distance between tabs.

To have the first tab at column 50 with tabs 10 apart, change this to:

If you want to set the tabs at particular columns, you could set the columns by specifying the column number in the command %{##} (where ## is the column) and using the %c  byte output flag, and then null terminating the parameters. The following example sets the tabs at 10, 20, and 45 columns.

%{10}
%c
%{20}
%c
%{45}
%c
'\0'
With this information you should now be able to get the virtual printer to obey your tabs. The other way to solve the problem is to move the tabs to the printer and let it add them. You can do this if you put the virtual printer in passthrough mode and add carriage returns to each line or send a command to have the printer add the lines. You may find it easier to make these simple changes to your virtual printer.




[ Doc Ref: 9179093479684     Publish Date: Feb. 13, 2001]