* Nigel Ridley <nigel at rmk.co.il> [2008-07-24 19:05:05 +0300]: > Setting up gs (8.61.dfsg.1-1ubuntu3) ... > nigel at laptop:~$ > nigel at laptop:~/Hamaayan/Example$ pdftops -level3 -paper match "$Example" > - | gs -q -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite > -dPDFSETTINGS=/ebook -dAutoRotatePages=/None -dEmbedAllFonts=true > -dSubsetFonts=true -sOutputFile="$example.pdf" -dCompatibilityLevel=1.4 > -c .setpdfwrite - > Error: Couldn't open file '' > nigel at laptop:~/Hamaayan/Example$ > >> >> What does gsc --help say, just out of curiosity? > > nigel at laptop:~$ gsc --help > *** WARNING -- Unknown or improperly placed option: "-help" > > nigel at laptop:~$ apt-cache policy gsc > W: Unable to locate package gsc > > nigel at laptop:~$ sudo apt-get install gsc > Reading package lists... Done > Building dependency tree > Reading state information... Done > E: Couldn't find package gsc > nigel at laptop:~$ apt-cache policy ghostscript > ghostscript: > Installed: 8.61.dfsg.1-1ubuntu3 > Candidate: 8.61.dfsg.1-1ubuntu3 > Version table: > *** 8.61.dfsg.1-1ubuntu3 0 > 500 http://archive.ubuntu.com hardy/main Packages > 100 /var/lib/dpkg/status > nigel at laptop:~$ > >> >> HTH, >> >> Tino. >> > > Not sure what to say - perhaps it's a Ubuntu thing...? > > Blessings, > > Nigel
Nigel, It's definitely not a ubuntu thing. Here is the script that worked on my Debian system, which means it will work on a Ubuntu system as well: ###################################################3 #!/bin/sh infile=$1 outfile=$2 pdftops -level3 -paper match "$infile" - | gs -q -dSAFER -dBATCH -dNOPAUSE -sDEVICE=pdfwrite -dPDFSET + TINGS=/ebook -dAutoRotatePages=/None -dEmbedAllFonts=true -dSubsetFonts=true -sOutputFile="$outfile + " -dCompatibilityLevel=1.4 -c .setpdfwrite - ###################################################3 I saved the above as a pdfcompress file and changed its permissions to executable by "chmod 700 pdfcompress". Then, I downloaded a random pdf file http://www.google.com/url?sa=t&ct=res&cd=4&url=http%3A%2F%2Fwww.irs.gov%2Fpub%2Firs-pdf%2Ffw4.pdf&ei=urSISOO5NZmIiwHFjsHhDA&usg=AFQjCNHdJoiSxm8m_ff8SZ6jMDWjFVFBMQ&sig2=aCsIh59K1wBclOnIfl507w and ran "pdfcompress fw4.pdf fw4compressed.pdf" and obtained the desired compression result: -rw-r--r-- 1 malex malex 41106 2008-07-24 11:03 fw4compressed.pdf -rw-r--r-- 1 malex malex 242545 2008-07-24 10:58 fw4.pdf Cheers, Alex. P.S.: And by the way, Debian and Ubuntu Ghostscript package names have changed around May 2007. All those gs-afpl gs-gpl gs-esp packages have been unified into a single "ghostscript" package with a "gs" binary executable.
