
In the command line, which is a black Command Prompt window, you can start it by Start menu / Run / cmd.exe, or finding Command Prompt in the start menu. To optimize a PDF, run the following command:Ĭ:\pdfsizeopt\pdfsizeopt input.pdf output.pdf and save it to C:\pdfsizeopt, as C:\pdfsizeopt\pdfsizeopt.single.

, and extract its contents to the folder C:\pdfsizeopt, so that the file C:\pdfsizeopt\pdfsizeopt.exe exists.

pdfsizeopt is a command-line only application, there is no GUI. There is no installer, you need to run some commands in the command line (black Command Prompt window) to download and install. Installation instructions and usage on Windows

You can also put pdfsizeopt to a directory other than ~/pdfsizeopt, as you like.Īdditionally, you can install some extra image imptimizers (see more in the``Image optimizers’’ section below):ĭocker run -v "$PWD:/workdir" -u "$(id -u):$(id -g)" -rm -it ptspts/pdfsizeopt-with-extraimgopt pdfsizeopt -use-image-optimizer=sam2p,jbig2,pngout,zopflipng,optipng,advpng,ECT input.pdf output.pdf To avoid typing ~/pdfsizeopt/pdfsizeopt, add “$HOME/pdfsizeopt” to your PATH (probably in your ~/.bashrc), open a new terminal window, and the command pdfsizeopt will work from any directory. pdfsizeopt also works perfectly on x86 FreeBSD systems with the Linux emulation layer enabled. because pdfsizeopt uses only its statically linked x86 executables, and it doesn’t use any external commands (other than pdfsizeopt, pdfsizeopt.single and pdfsizeopt_libexec/*) on the system. There is no restriction on the libc, Linux distribution etc. Please note that pdfsizeopt works perfectly on any x86 and amd64 Linux system. It’s possible to install some of the dependencies with your package manager, but these steps are considered alternative and more complicated, and thus are not covered here. Please note that the commands above download all dependencies (including Python and Ghostscript) as well. To do that, specify the pathname (including the directory name) in the command-line.

It’s possible to optimize a PDF outside the current directory. Pdfsizeopt creates lots of temporary files (psotmp.*) in the output directory, but it also cleans up after itself. ~/pdfsizeopt/pdfsizeopt -use-pngout=no input.pdf output.pdf
