Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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:

Linux (Bash)

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).

Windows

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).

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:

Linux (Bash)

Use the gs command:

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).

Windows

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).