linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Knoell <jens@surefoot.com>
To: linux-admin@vger.kernel.org
Subject: Odd ghostscript problem (ps to PDF conversion)
Date: Thu, 27 Jul 2006 12:48:02 -0600	[thread overview]
Message-ID: <44C90A62.3070401@surefoot.com> (raw)

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 me 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=8.5 -imageheight=14 | 
ps2pdf14 -sPAPERSIZE=legal - `echo $filename|cut -d. -f1`.pdf
  rm $filename
  echo "done. Source deleted."
done

echo -n "Concatenating PDF files ... "
gs -dBATCH -dNOPAUSE -dCompatibilityLevel=1.4 -q -sDEVICE=pdfwrite 
-sPAPERSIZE=legal -sOutputFile="/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."


Does anyone see something obviously wrong? I don't :(

Jens

             reply	other threads:[~2006-07-27 18:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-27 18:48 Jens Knoell [this message]
2006-08-12  2:47 ` Odd ghostscript problem (ps to PDF conversion) Gustavo Guillermo Pérez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44C90A62.3070401@surefoot.com \
    --to=jens@surefoot.com \
    --cc=linux-admin@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).