On Thu, Jul 31, 2003 at 01:25:11PM +0200, Henk Abma wrote: > What I wanted to do was to scan a sheet of paper, and reproduce it on my > printer, sort of a command-line copier. > > Since my printer is at 300 dpi, I thought it would be simple: scan the > paper at 300 dpi, and enter: lpr scanned-paper. > > Hovever this gives the result of enlarging the image, so it now occupies 4 > or 5 pages. > > So the question is, how do I estimate the resolution so that it will > occupy only one page. or is there another commandline based solution?
Well, by default, pnmtops in the netpbm package will convert a Portable aNyMap to Postscript, and always reduce it to fit on one page. (You can do 'pnmtops -scale 0.25 <input |lpr' to explicitly scale it down; by default it will enlarge the image four times to change a 72dpi image to a 300dpi image, then reduce the result if it's too big for the page.) Nice thing about the netpbm programs is they all take standard input and output, so they can be used as chained filters and easily used for batch jobs. Might be useful if you gave us a better idea of what you were doing now, what programs you were using (including which print filters) and what intermediate formats. As another note, what you're doing doesn't necessarily produce the results you might expect: 300dpi for a scanner means you can still get 16-bit or more shades of grey in that one pixel; 300dpi for a printer normally means that the pixel is strictly either black or white. (Things like HP's 'Resolution Enhancement Technology' modify this, giving you a couple of levels of black by varying the size of the ink droplet.) Net result is that when you pass the printer a 300dpi greyscale image, it's still going to have to go through the usual pixel dithering to approximate greys. And a lot of printers of the 300dpi era use a fairly large 'halftone screen' by default, so the dithering will be noticeable. Of course, if what you're copying is straight text or the like and you're scanning purely on monochrome, that's not a problem. ---------------------------+--------------------------------------------------- Bryan Feir VA3GBF|"Every man has somewhere in the back of his head Home:[EMAIL PROTECTED] | the wreck of a thing which he calls his | education." -- Stephen Leacock ---------------------------+--------------------------------------------------- -- [EMAIL PROTECTED] mailing list