Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How to Print .tif files using a shellscript in unix

Posted on 2008-06-11
4
Medium Priority
?
569 Views
Last Modified: 2013-12-26
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!
0
Comment
Question by:viveksapre
  • 2
4 Comments
 
LVL 2

Expert Comment

by:knowledge_riot
ID: 21767059
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/
0
 

Author Comment

by:viveksapre
ID: 21769453

     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.
0
 
LVL 4

Expert Comment

by:robertfwoods
ID: 21778233
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.
0
 

Accepted Solution

by:
viveksapre earned 0 total points
ID: 21955868
I was able to manage it using java. sorry for not updating it earlier.

Thanks
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

886 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question