Any suggestions for shrinking a PDF file?

后端 未结 10 986
名媛妹妹
名媛妹妹 2021-02-03 11:34

We\'ve got a .net 2.0 web system that dynamically builds pdf files. Some of these files can get pretty large - 12MB+. While processing time isn\'t a factor, really, the size

10条回答
  •  没有蜡笔的小新
    2021-02-03 12:10

    Use Ghostscript, which is also available for the 32bit and 64bit Windows platforms. It recognises all Adobe Distiller parameters[1] and honors most of them. On top of that, you can inject PostScript programs into the conversion process. I use it for a year now in a pre-print production environment on image-heavy PDFs. If the parameters are set correct, the file-size can go from 40MB down to 800kB with no visible loss of quality. I found it to be quite fast, in fact the documentation states that it may be faster than Adobe Distiller.

    And it is free (as in beer as well as in speech).

    [1] See distparm.pdf in the help folder of Distiller or look here.

    How you use it

    You call it from the command line with all your wanted parameters, input and output-files and you're done.

    Quick example:

    gs -dBATCH -dNOPAUSE -sDEVICE=pdfwrite\
       -dCompatibilityLevel=1.3 -dEncodeColorImages=true\
       -sOutputFile=output.pdf input.pdf
    

    Some valuable resources:

    • Ghostscript PDF writer tips
    • Postscript-to-PDF converter documentation

提交回复
热议问题