[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [Sheflug] PDF



On 04-Nov-01 Richard Ibbotson wrote:
> Dear all
> 
> I've been happily producing PDF files for some time with ps2pdf.  I 
> now find that it's no longer available.  Or ... I just can't find a 
> download page.
> 
> I can see that there is another editing tool on my hard drive which 
> is pstoedit.  Does this produce PDF files from postscript and if so 
> how do I use it to convert PS to PDF ?  Tried looking for a man page 
> and a web site but can't find those either.
 
Hi Richard,

ps2pdf is part of ghostcript (in fact /usr/bin/ps2pdf is a little
script which invokes ghostscript in such a way that gs uses the
output device pdfwrite).

Not sure what you mean by "ps2pdf is no longer available" -- if you
have ghostscript you should have ps2pdf unless you did something
to your system which "lost" it.

If you lost it, the full ps2pdf script from my SuSE-7.2 is appended.

If you're looking for download, you'll have to go to

  http://www.ghostscript.com

pstoedit is NOT a good idea for producing PDF:

       pstoedit converts PostScript and PDF  files  to  a  simple
       vector  graphic format that can be edited or imported into
       various drawing packages.  Type
              pstoedit -help
       to get a list of supported output formats.
       ....
       pstoedit works by redefining the two basic painting opera­
       tors of PostScript, stroke and show.  Other drawing opera­
       tors (e.g.  image) are not  supported.

While PDF (and also PS) are two of the output formats which
pstoedit supports, the primitive way it works means that you
take pot luck on the quality of the output and on whether it
will work at all (I just tried it on a file which I previously
converted to PDF with ps2pdf without problems. pstoedit
crashed on it).

In any case, ps2pdf only works by invoking ghostscript after
redefining the stoke and show operators. So you have to have
ghostscript anyway. And if you have ghostscript, you may as
well make sure it includes ps2pdf and that this has not got lost!

Below, please find the /usr/bin/ps2pdf script; for a manual
workround, just use the last line (with your desired filenames
substituted for the $... parameters).

Hope this helps!
Ted.
=======================================================
#!/bin/sh
# $Id: ps2pdf $
# Convert PostScript to PDF.

OPTIONS=""
while true
do
        case "$1" in
        -*) OPTIONS="$OPTIONS $1" ;;
        *)  break ;;
        esac
        shift
done

if [ $# -lt 1 -o $# -gt 2 ]; then
  echo "Usage: `basename $0` [options...] \
    input.ps [output.pdf]" 1>&2
  exit 1
fi

infile=$1;

if [ $# -eq 1 ]
then
        case "${infile}" in
          *.ps)         base=`basename ${infile} .ps` ;;
          *)            base=`basename ${infile}` ;;
        esac
        outfile=${base}.pdf
else
        outfile=$2
fi

# Doing an initial 'save' helps keep fonts from being flushed
# between pages.

exec gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite \
  -sOutputFile=$outfile $OPTIONS -c save pop -f $infile

=================================================================

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding [at] nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 04-Nov-01                                       Time: 21:48:04
------------------------------ XFMail ------------------------------
___________________________________________________________________

Sheffield Linux User's Group - http://www.sheflug.co.uk . 
To unsubscribe from this list send mail to 
shef-lug-request@list.sheflug.org.uk with the word
"unsubscribe" in the body of the message. 

  GNU the choice of a complete generation.