title: itextsharp generating PDF into client browser: (Vb.net)
body: <p>I'm currently trying to make itextsharp generating PDF file into the browser using .NET framework.. and yes, I'm using VB.net instead of C# here...</p>
  
  <p>I already compiled everything and it's no error.
  What makes the browser didn't send me the pdf result? 
  I wonder if i forgotten something?</p>
  
  <p>Source Code:</p>
  
  <pre><code>Private Sub createPDF()
  
      Using ms As New MemoryStream()
  
          Dim document As New Document(PageSize.A4, 25, 25, 30, 30)
          Dim writer As PdfWriter = PdfWriter.GetInstance(document, ms)
          document.Open()
          document.Add(New Paragraph("Hello World"))
          document.Close()
  
          writer.Close()
          Response.ContentType = "pdf/application"
          Response.AddHeader("content-disposition", "attachment;filename=First PDF document.pdf")
  
          Response.OutputStream.Write(ms.GetBuffer(), 0, ms.GetBuffer().Length)
      End Using
  
  End Sub
  </code></pre>