Faximum TechNote #090

Faximum TechNote #090

(http://www.faximum.com/technotes/090)

TITLE:    #090 - Problems aligning text with forms using forms overlay

KEYWORDS: forms overlay alignment line printer intercept image shift position margin

RELEASE:  All

CLASSIFICATION: All

PROBLEM:  Customer reports that the data being faxed (using the line printer
	  intercept or other mechanism) is not properly aligned with the 
	  image being used the forms overlay.

CAUSE:	  The origin of the form and the text may not be aligned and/or the
	  default character and line spacing of the text may not match the
	  form (especially if the form has been slightly stretched or reduced
	  as a result of the scanning process).

SOLUTION: There are three possible solutions to this problem:

		1) shift the forms overlay image;
		2) change the margins or print spacing of the text; and
		3) combine a bit of 1 and 2.


	   Section 1 - Shifting the TIFF Overlay Image
	   -------------------------------------------

	   The easiest way to shift the forms overlay image is to use the
	   asciitiff utility (see the manual page for asciitiff which is
	   in the Reference Manual for the PLUS products or on-line for the
	   Client/Server products) and the tiffinclude command.  For example, 
	   if you were to create a file called shift.txt which contains the
	   following single line of text:

	       @[set indent 0]@[tiffinclude form.tif 0.5i 0]@[moveto 0 0]

	   (replace the @ symbols in the above line with $ symbols.)
	
	   and then were to run asciitiff:
	       /opt/faximum/bin/asciitiff shift.txt
	
	   (the actual pathname for the asciitiff command may vary 
	   depending on the version and type of product you are 
	   running. Other common locations include /usr/fax/bin, 
	   /usr/faximum/bin, /opt/FAXserver/bin, and 
	   /opt/faximum/fms/bin)
	
	   then this would produce a TIFF file called shift.tif which 
	   would contain the original form.tif image shifted to the 
	   right 0.5 inches.  By modifying the arguments to the 
	   tiffinclude command one can change the amount the image is 
	   shifted.  To shift the image down the page, change the 
	   second number to the tiffinclude command.


	   Section 2 - Shifting the Text on the Page
	   -----------------------------------------

	   To shift the position of the text one uses the appropriate PCL
	   commands.  The exact method of inserting the PCL commands into
	   the print stream depends on how one is using the line printer
	   intercept.

	   1.  If one is sending the print file to the line printer spooler
	       one could add the PCL commands to the beginning of the print 
	       file itself.
	
	   2.  If one is sending the print file to the line printer spooler
	       one could add the PCL commands to those already in the line
	       printer interface script which calls the lpfax command.
	       (For example, on SCO machines, look in the script directory
	       /usr/spool/lp/admins/lp/interfaces/).

	       If the PCL alignment commands are specific to a single form
	       and you plan to use more than one form, then consider defining
	       separate line printer spooler destinations for each form 
	       (which will result in separate line printer interface scripts 
	       for each destinations) and then edit each script appropriately.
	
	   3.  If one is calling the lpfax utility directly (i.e. from AIX),
	       then merely add the PCL command to the call to lpfax.  Example:
		/usr/fax/lib/lpfax -p '\E&l4E'

	   Here is a list of PCL commands that can be used to change the
	   alignment of the text.  The first set can be used to expand or
	   shrink the text; the second set affect where the first character
	   is placed on the page; and the remainder may be used to affect
	   other characteristics of the output.

	Text Size Commands

       \E&l#C  height of each row of print (where # is in units of 1/48 in.)
       \E&k#H  width of each column of print (where # is in 1/120 in. units)

	Note that the column width is reset to the default for the font
	whenever a font selection command is issued so if one is changing
	fonts in the middle of the document then you must reset the width
	using the above command after each font selection command.

	Text Positioning Commands

       \E&l?U  shift all text right (? in units of 1/720 in.)
       \E&l-?U shift all text left  (? in units of 1/720 in.)
       \E&l?Z  shift all text down  (? in units of 1/720 in.)
       \E&l-?Z shift all text up    (? in units of 1/720 in.)

       \E&a#L  left margin (where # is the column number, must be >= 0)
       \E&l#E  top margin (where # is the line number, must be >= 0)

	Page Size and Orientation Commands

       \E&l?F  number of lines on each page before jumping to a new page
       \E&a?P  page orientation (0=portrait, 90=landscape...)
       \E&l?A  paper size (2=letter, 3=legal, default from style)

       		# represents any positive decimal number
		? represents any positive integer

	    Note that in the above escape sequences, l is the letter L, not 
	    the digit 1.

	    To learn more about Hewlett-Packard's Printer Control Language
	    (PCL), order their "PCL/PJL Technical Reference Package"
	    (HP Part No. 5010-3994) which contains detailed documentation
	    on the PCL language.  HP Parts Direct may be reached through
	    1 800 227 8164 (US) or 1 800 387-3154 (Canada).  In other
	    countries contact your local HP office.


Tech Note: 090 - Copyright 2001 Faximum Software Inc., All Rights Reserved.
http://www.faximum.com/technotes/090  Revised: Fri Feb  2 06:18:39 PST 2001

© Copyright 2001 Faximum Software Inc. All Rights Reserved.