pdftk compression option

前端 未结 10 1073
一向
一向 2020-12-04 04:55

I use pdftk to compress a pdf using the following command line

pdftk file1.pdf output file2.pdf compress

It works as the w

相关标签:
10条回答
  • 2020-12-04 05:57

    In case you want to compress a PDF which contains a lot of selectable text, on Windows you can use NicePDF Compressor - choose "Flate" option. After trying everything (cpdf, pdftk, gs) it finally helped me to compress my 1360 pages PDF from 500 MB down to 10 MB.

    0 讨论(0)
  • 2020-12-04 06:01

    If file size is still too large it could help using ps2pdf to downscale the resolution of the produced pdf file:

    pdf2ps input.pdf tmp.ps
    ps2pdf -dPDFSETTINGS=/screen -dDownsampleColorImages=true -dColorImageResolution=200 -dColorImageDownsampleType=/Bicubic tmp.ps output.pdf
    

    Adjust the value of the -dColorImageResolution option to achieve a result that fits your needs (the value describes the image resolution in DPIs). If your input file is in grayscale, replacing Color through Gray or using both options in the above command could also help. Further fine-tuning is possible by changing the -dPDFSETTINGS option to /default or /printer. For explanations of the all possible options consult the ps2pdf manual.

    0 讨论(0)
  • 2020-12-04 06:01

    After trying gpdf as nullglob suggested, I found that I got the same compression results (a ~900mb file down to ~30mb) by just using the cups-pdf printer. This might be easier/preferred if you are already viewing a document and only need to compress one or two documents.

    In Ubuntu 12.04, you can install this by

    sudo apt-get install cups-pdf
    

    After installation, be sure to check in System Tools > Administration > Printing > right-click 'PDF' and set it to 'enable'

    By default, the output is saved into a folder named PDF in your home directory.

    0 讨论(0)
  • 2020-12-04 06:02

    this procedure works pretty well

    pdf2ps large.pdf very_large.ps
    
    ps2pdf very_large.ps small.pdf
    

    give it a try.

    0 讨论(0)
提交回复
热议问题