Thursday, December 8, 2011

PDF Compression by iTextsharp


string pdfFile = @"D:\google.pdf";
PdfReader reader = new PdfReader(pdfFile);
PdfStamper stamper = new PdfStamper(reader, new FileStream(@"D:\google.pdf", FileMode.Create), PdfWriter.VERSION_1_5);
stamper.FormFlattening = true;
stamper.SetFullCompression(); 
stamper.Close();