You can also put pdfsizeopt to a directory other than C:\pdfsizeopt, but it won’t work if there is whitespace or there are accented characters in any of the folder names. \x7f] in filenames at all, and it uses / and \ as directory separator. This is because Windows doesn’t support these characters ([\x00.\x1f": Filenames with some punctuation characters (such as double quote (“), question mark (?) and asterisk ( )) and nonprintable characters (such as newline) will not work on Windows. Spaces in filenames and pathnames should work, but you need to put double quotes (“) around the name. The backslash () and the slash (/) are both OK as the directory separator. Play it safe, make sure your input and output files have names with letters, numbers, underscore (_), dash (-), dot (.) and plus (+). To avoid typing C:\pdfsizeopt\pdfsizeopt, add C:\pdfsizeopt to (the end of) the system PATH, open a new Command Prompt window, and the command `pdfsizeopt’ will work from any directory.ĭepending on your environment, filenames with accented characters may not work in the Windows version of pdfsizeopt. You can speed it up by disabling pngout, the slowest image optimization method, like this:Ĭ:\pdfsizeopt\pdfsizeopt –use-pngout=no input.pdf output.pdf If the input PDF has many images or large images, pdfsizeopt can be very slow. C:\pdfs), and copy the input PDF there first. Since you have to type the input filename as a full pathname, it’s recommended to create a directory with a short name (e.g. (Press Tab to get filename completion while typing.) 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
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |