|
InstallationInstructionLinux
Installation instructions for LinuxInstallation(For quick installation of pdfsizeopt to Windows systems, please see InstallationInstructionWindows, and for slow installation on any system, please see InstallationInstructions instead.) Please note that pdfsizeopt has many binary dependencies, but all these dependencies are conveniently bundled to a ~14 MB .tar.gz file ( pdfsizeopt_libexec_linux-v1.tar.gz below) for easy installation on Linux and FreeBSD. Run these commands in a terminal window (without the leading $): $ mkdir pdfsizeopt.try $ cd pdfsizeopt.try $ wget -c \ http://pdfsizeopt.googlecode.com/files/pdfsizeopt_libexec_linux-v1.tar.gz $ tar xzvf pdfsizeopt_libexec_linux-v1.tar.gz $ wget -O pdfsizeopt.py http://pdfsizeopt.googlecode.com/git/pdfsizeopt.single Please note that pdfsizeopt works perfectly on any x86 and amd64 Linux system. There is no restriction on the libc, Linux distribution etc. because pdfsizeopt uses only its statically linked x86 executables, and it doesn't use any external commands (other than pdfsizeopt and pdfsizeopt_libexec/*) on the system. pdfsizeopt also works perfectly on x86 FreeBSD systems with the Linux emulation layer enabled. Usagepdfsizeopt is a command-line only application, there is no GUI. You can run pdfsizeopt by opening a terminal window and typing commands there. The command includes the pathname to the pdfsizeopt binary and the input file name. For example, to compress the sample lme_v6.pdf file, run these commands in a terminal window (without the leading $): $ cd pdfsizeopt.try $ wget -c \ http://pdfsizeopt.googlecode.com/files/lme_v6.pdf $ ./pdfsizeopt --use-pngout=no lme_v6.pdf $ ls -l lme_v6.pdf lme_v6.psom.pdf Additional image compression is possible by removing --use-pngout=no, but that would make the whole process much slower, because pngout is very slow. It's possible to run pdfsizeopt from any directory. To do that, change the ./ in the command above to the name of the directory containing pdfsizeopt (and pdfsizeopt_libexec), or add the directory containing pdfsizeopt to your path. Please note that the pdfsizeopt_libexec directory and the pdfsizeopt.py file must be always next to the pdfsizeopt executable. It's possible to optimize a PDF outside the current directory. To do that, specify the pathname (including the directory name) in the command-line. pdfsizeopt creates lots of temporary files (pso.*) in the currect directory. As of now, you have to clean up those files manually. The output file name for DIR/INPUT.pdf is DIR/INPUT.psom.pdf (or DIR/INPUT.pso.pdf if pdfsizeopt --use-multivalent=no is used). |
I tried setting up a shell script in my path that does something like
cd /location/where/pdfsizeopt/is/installed ./pdfsizeopt "@"
but it fails because now I've changed directory and my file isn't there. Can I tell pdfsizeopt to use a different directory for input and output? I find it a bit cumbersome to copy all PDFs to the install directory...
@stephen.beckr: Put the directory containing pdfsizeopt to your PATH, and then you can execute it from anywhere.
The link to download the file is not working.
Link to download should be http://pdfsizeopt.googlecode.com/files/pdfsizeopt_libexec_linux-v2.tar.gz instead of http://pdfsizeopt.googlecode.com/files/pdfsizeopt_libexec_linux-v1.tar.gz
When I try to run it, it ends with: "AssertionError?: Multivalent.jar not found, see above"
The file that the v2 tar created for me is pdfsizeopt.py and not pdfsizeopt. After making it executable and running ./pdfsizeopt.py --use-pngout=no lme_v6.pdf, I get "AssertionError? Ghostscript gs does not seem to work." An earlier message says "sh: gs: not found".
Not sure what I need to get it working.
Not works as expected
error: Multivalent.jar not found. Make sure it is on the $PATH, or it is one of the files on the $CLASSPATH. Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 72, in run_code File "./pdfsizeopt/main.py", line 1, in <module> File "./pdfsizeopt/mainrun.py", line 10, in <module> File "./pdfsizeopt/pdfsizeopt/main.py", line 8081, in main File "./pdfsizeopt/pdfsizeopt/main.py", line 7773, in Save File "./pdfsizeopt/pdfsizeopt/main.py", line 7660, in RunMultivalent? AssertionError?: Multivalent.jar not found, see above