There are several ways to compress a PDF file on both Linux and Windows platforms without using any online tools. Here are a few options:
Use the gs command: The gs command, which stands for Ghostscript, is a powerful tool for manipulating PDF files on Linux. To compress a PDF file using gs, you can use the following command:
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/screen -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
This command uses the pdfwrite device to create a new PDF file (output.pdf) with a reduced file size compared to the original input file (input.pdf). The -dPDFSETTINGS=/screen option sets the compression level to screen-resolution quality, which is suitable for most purposes. You can adjust this option to ebook or printer for higher quality, but larger file sizes.
Use the pdftk command:
The pdftk command is another powerful tool for manipulating PDF files on Linux. To compress a PDF file using pdftk, you can use the following command:
pdftk input.pdf output output.pdf compress
This command creates a new PDF file (output.pdf) with a compressed file size compared to the original input file (input.pdf).
Use the Adobe Acrobat Pro: Adobe Acrobat Pro is a commercial software that provides several features for manipulating PDF files, including compression. To compress a PDF file using Adobe Acrobat Pro, you can follow these steps:
Open the PDF file in Adobe Acrobat Pro. Click on File > Save As Other > Reduced Size PDF. Select the compression level you want to use, and click OK. Use the qpdf command:
The qpdf command is a free and open-source command-line tool for manipulating PDF files on Windows. To compress a PDF file using qpdf, you can use the following command:
qpdf --compress-streams=y input.pdf output.pdf
This command creates a new PDF file (output.pdf) with a compressed file size compared to the original input file (input.pdf).
Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss
Asked: 2023-04-05 09:33:08 +0000
Seen: 10 times
Last updated: Apr 05
I am serving a site via a Nginx Proxy. How can I enable Text Compression?
What are the Advantages of the 7z Format?
What does the "unknown directive brotli" error indicate when trying to start nginx?
Easy way to list the large Subdirs of a Directory in Ubuntu
How can I fix error: Security violation, ping RPC from uid 1001 in Slurm log?
I want to grep for "```*" in a File, in other Words: "```" followed by any Word