title: Compress a Pdf using iTextSharp
body: <p>I found many samples on the web, one of these:</p>
  
  <pre><code>var oldFile = @"C:\Users\XXX\Downloads\3921B2014901_2014_7346.pdf";
  var newFile = @"C:\Users\XXX\Downloads\new\3921B2014901_2014_7346.pdf";
  
  RandomAccessFileOrArray raf = new RandomAccessFileOrArray(oldFile);
  PdfReader reader = new PdfReader(raf, null);
  using (FileStream fs = new FileStream(newFile, FileMode.Create))
  {
      PdfStamper stamper = new PdfStamper(reader, fs, PdfWriter.VERSION_1_5);
      PdfWriter writer = stamper.Writer;
      writer.SetPdfVersion(PdfWriter.PDF_VERSION_1_5);
      writer.CompressionLevel = PdfStream.BEST_COMPRESSION;
  
      for (int i = 1; i &lt;= reader.NumberOfPages; i++)
      {
          reader.SetPageContent(i, reader.GetPageContent(i), PdfStream.BEST_COMPRESSION, true);
      }
      stamper.SetFullCompression();
      stamper.Close();
  }
  reader.Close();
  raf.Close();
  </code></pre>
  
  <p>The original file is 2.75Mb and the resulting new file is 2.77Mb. Why?</p>
  
  <p>I tried online converters and they reduce the same file to 500Kb. How can I achieve the same result?</p>