Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi guys,
i need to open a pdf file and reduce size!

I wrote this code:

C#
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()


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
Posted

1 solution

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900