如何在VB.net中使用iTextSharp减小PDF图像的大小 [英] How to reduce PDF images size with iTextSharp in VB.net
本文介绍了如何在VB.net中使用iTextSharp减小PDF图像的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
i需要打开一个pdf文件并缩小尺寸!
我写了这段代码:
Hi guys,
i need to open a pdf file and reduce size!
I wrote this code:
Dim pdfFile As String = "D:\pdf\1.pdf"
Dim reader As New PdfReader(pdfFile)
Dim stamper As New PdfStamper(reader, New FileStream("D:\pdf\1c.pdf", FileMode.Create), PdfWriter.VERSION_1_5)
Document.Compress = True
stamper.FormFlattening = True
stamper.SetFullCompression()
stamper.Close()
但是我获得了一份与原版相同尺寸的新pdf文件。
我应该用pdf压缩图像吗?如果怎么做?
非常感谢!
Alex
But i obtain a new pdf file with same size of original.
Should i compress images in pdf? In case how to do this?
Thanks a lot!
Alex
推荐答案
http://www.dotnetspark.com/kb/1807-pdf-compression -by-itexsharp.aspx [ ^ ]
如何使用c#和iTextSharp 优化(压缩)pdf [ ^ ]
http://forums.asp .net / t / prev / 1857554 [ ^ ]
http://www.dotnetspark.com/kb/1807-pdf-compression-by-itexsharp.aspx[^]
How to optimize(compress) pdf using c# and iTextSharp[^]
http://forums.asp.net/t/prev/1857554[^]
如果您真的想减小PDF的大小,请查看Aspose.PDF:
http://www.aspose.com/docs/display/pdfnet/Optimize+PDF+file+size [ ^ ]
我能够将尺寸缩小约5.6倍(100页从16.8MB减少到3MB)
If you're really looking to reduce the size of PDF's look at Aspose.PDF:
http://www.aspose.com/docs/display/pdfnet/Optimize+PDF+file+size[^]
I was able to reduce the size by about 5.6 times (100 pages went from 16.8MB down to 3MB)
这篇关于如何在VB.net中使用iTextSharp减小PDF图像的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文