Link to home
Create AccountLog in
Avatar of viveksapre
viveksapre

asked on

How to Print .tif files using a shellscript in unix

Hi,

 I am developing a program which will allow users to print  .tif files (po / invoice images) to a printer from unix using 'lp'.

 I am running the command:

 lp -o nobanner -d"${PAR_PRINTER_NAME}" "${PAR_DOC_NAME}"

where PAR_PRINTER_NAME is the printer's name
and PAR_DOC_NAME is the image file name say abcd1234.tif.

The Problem is that the printer seems to split a single page into 4 pages. It prints the top left part of the page on  one page, top right half on another, bottom left half on one page and bottom right half on another.

 If I manually ftp the file on to my local machine and try to print it through Windows, it prints properly on one page. I have been able to print other types of files (non .tif) successfully using the above command.
 I am not sure what the issue is but looks like the .tiff files is getting printed as 4 tiles or 4 parts.

 Could some one please help me in this regard?
Should I try converting the .tif files to some other format? if so how can it be done?

Thanks in Advance!
Avatar of knowledge_riot
knowledge_riot
Flag of United Kingdom of Great Britain and Northern Ireland image

I have never actually tried it, but you could try converting the TIFF to PostScript first (using the unix tiff2ps command), and then print the PostScript (assuming the printer is PostScript compatible)
See: http://www.remotesensing.org/libtiff/man/tiff2ps.1.html

Another alternative would be to use GhostScript to generate PDFs and try printing them
http://www.firstpr.com.au/sys-admin/TIFF-to-PDF/
Avatar of viveksapre
viveksapre

ASKER


     I don't have the tiff2ps command on the unix servers that's used in our project. I'll have to check if our sysadmins can get that installed. Before that I'll try converting it online to a pdf / jpeg and try printing it out.
For a most elegent and useful tool,

visit http://www.swiftview.com/

Their product Swiftview will do the job nicely.

There is a price, and no I am not associated.
Just a user of their product over the years.

PS Look here http://www.swiftview.com/tech/supportfiles.htm
for tiffy a neat tool to print the tags in a tiff file.
ASKER CERTIFIED SOLUTION
Avatar of viveksapre
viveksapre

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer