From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gustavo Guillermo =?iso-8859-1?q?P=E9rez?= Subject: Re: Odd ghostscript problem (ps to PDF conversion) Date: Fri, 11 Aug 2006 21:47:03 -0500 Message-ID: <200608112147.03268.gustavo@compunauta.com> References: <44C90A62.3070401@surefoot.com> Mime-Version: 1.0 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <44C90A62.3070401@surefoot.com> Content-Disposition: inline Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="iso-8859-1" To: Jens Knoell , linux-admin@vger.kernel.org El Jueves, 27 de Julio de 2006 13:48, escribi=F3: > I'm occasionally converting scanned images to PDF files, people seem = to > be able to read/print them easier. > > I have two scripts that basically run through the scanned .png files = and > spit out a single PDF in the end. This works for LETTER size, but not > for LEGAL size, and I don't know why. What happens is this: The scan = has > the proper format (legal size), conversion to pnm and then ps gives m= e a > properly legal sized postscript file - but as soon as ghostscript > processes it, the document gets shifted down by an inch or so, and an > inch of information gets lost at the end of the page. Why? I wish I > knew. The script is as follows: > > #!/bin/bash > cd ~scanner > > for filename in `ls *.png` ; do > echo -n "Converting $filename to PDF ... " > pngtopnm $filename | pnmtops -imagewidth=3D8.5 -imageheight=3D14 | > ps2pdf14 -sPAPERSIZE=3Dlegal - `echo $filename|cut -d. -f1`.pdf > rm $filename > echo "done. Source deleted." > done > > echo -n "Concatenating PDF files ... " > gs -dBATCH -dNOPAUSE -dCompatibilityLevel=3D1.4 -q -sDEVICE=3Dpdfwrit= e > -sPAPERSIZE=3Dlegal -sOutputFile=3D"/mnt/server/PDF/ScanImage `date += "%a %F > %H.%M.%S"`.pdf" `ls *.pdf` > echo "done." > echo -n "Cleaning up ... " > rm *.pdf > chmod -R a+rw "/mnt/server/PDF" > > echo "done." > Try to do not specify paper size on ghostcript, in some countries there= exist=20 a paper size so called "oficio" too like to "legal" that has about 1 in= ch=20 (2cm) of less paper than "legal" we use to increase in our documents th= e=20 footer margin to fit on "officio", I don't know how this should be=20 translated. And why you do not try to use psutils, for doing everything including t= he=20 join, and later just convert ps to pdf. :) --=20 Gustavo Guillermo P=E9rez Compunauta uLinux www.compunauta.com - To unsubscribe from this list: send the line "unsubscribe linux-admin" = in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html