iTextSharp, Why when creating a PDF file size is 2 times larger than the original folder with images?

别来无恙 提交于 2019-12-11 17:21:29

问题


I need the finished PDF file to be 30% smaller than the original image folder.

There is a folder with images in tiff format. Then I add one image per page (Doc = new document (), etc.), the resulting document size is equal to the size of the image folder. But after passing the doc.Close() PDF file size increased two times (so I use compression PDF later and then the file is approximately equal to the folder), but I need the finished PDF file to be 30% smaller than the original image folder.


回答1:


Most image formats are already compressed, so they won't compress any more. PDFs usually compress because they're mostly text, but one that is mostly images won't.

Also, compression routines usually assume that the data is suitable for compression. If you give them pre-compressed data, the result can be a larger file. It's hard to tell exactly what happened without seeing your files, but I guess that's the reason.

If you want a smaller file, you'll have to reduce the amount of information in your images. Crop them, reduce the colour depth, increase the compression or reduce the number of images.



来源:https://stackoverflow.com/questions/55489699/itextsharp-why-when-creating-a-pdf-file-size-is-2-times-larger-than-the-origina

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!