Ask Your Question
0

What are the best Ways to compress a PDF?

asked 2023-04-05 09:33:08 +0000

qstack gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-04-05 09:35:45 +0000

qstack gravatar image

updated 2023-04-05 09:41:20 +0000

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

edit flag offensive delete link more

Your Answer

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

Add Answer


Question Tools

1 follower

Stats

Asked: 2023-04-05 09:33:08 +0000

Seen: 1,456 times

Last updated: Apr 05 '23