On Fri, Jul 01, 2005 at 01:52:02AM +0100, Ted Harding wrote:
On 30-Jun-05 Anthony Anson wrote:
The message 20050630201420.GA8048@areti.co.uk from Chris Green chris@areti.co.uk contains these words:
I have some GIF and JPG files (they're maps of wine producing areas in France) that I want to print. What's the easiest application to use to do this? All I want is for the image to be scaled to the best size to fit a sheet of A4 paper, no other manipulation is required.
When I just opened the file from the xfce file manager using the default application it opened with ImageMagick, it looked perfect on screen but when I selected print the printout was displaced so that only half of it was printed. The orientation was right, it was just shifted down. I couldn't find any way to set up the printout in ImageMagick. I'm not even sure what sort of ImageMagick is being invoked - almost as bad as Windows!
I'm going to chip in with an ancient but effective suggestion, in the old Unix tradition of getting Linux to work for you.
You have ImageMagick, Chris, so you have 'convert', so:
convert yourimage.gif yourimage.eps
Prepare a text file "myprint.tr" with contents
.LP .PSPIC yourimage.eps 6i
- Run
groff -Tps -ms myprint.tr > myprint.ps
You then have a PostScript file "myprint.ps" which you can view with
gv myprint.ps
and, if satisfied:
Print this by whatever means you use to print PS files.
The setup of "myprint.tr" will give you the image centred on the page, at the top of the printing area (with a 1-inch header margin) and 6 inches wide.
a) To change the width, alter the "6i" in the ".PSPIC" line.
b) To change the vertical placement:
-- To move it further down the page, change the text to
.LP .sp 2.5i .PSPIC yourimage.eps 6i
which will move it down 2.5 inches.
-- To move it further up, decrease the Header Margin, e.g.
.nr HM 0.6i .LP .PSPIC yourimage.eps 6i
which, instead of a default 1-inch header Marging will give you 0.6i (i.e. 0.4i furtherup the page).
Tune things as above until you are satisfied (testing with the 'gv' viewer).
You can generalise the above with a script, e.g. "printscript":
#! /bin/bash NAME=$1 TYPE=$2 WID=$3 VMOVE=$4 if ! [ -e $NAME.eps ] ; then convert $NAME.$TYPE $NAME.eps ; fi groff -Tps -ms - > $NAME.ps << EOT .nr HM 1i+$VMOVE .LP .PSPIC $NAME.eps $WID EOT
and run it as (e.g.)
printscript yourimage gif 5i -0.5i
which would generate the PostScript file "yourimage.ps" containing the graphic "yourimage.gif" centred, 5 inches wide, and moved up 0.5 inches relative to a Header Margin of 1 inch.
If you view the first run with
gv -watch -media a4 yourimage.ps &
then 'gv' will re-draw its image each time the PS file changes, so you can tweak the third ($WID) and 4th ($VMOVE) arguments until you like the result. In fact, you can play with the script to your heart's content.
Good hunting, and best wishes, Ted.
Er, um, that really does seem a bit OTT just to print soemthing!