Dim PdfPath As String = "~/Pdf/Letter.pdf"
Dim pdfReader As New PdfReader(HttpContext.Current.Request.MapPath(PdfPath))
Dim pdfStamper As New PdfStamper(pdfReader, m)
pdfStamper.FormFlattening = True
Dim pdfForm As AcroFields = pdfStamper.AcroFields
'Add in address - AddressString is straight from DB
pdfForm.SetField("Address", AddressString)
pdfReader.Close()
pdfStamper.Close()
Dim Pdfstream As MemoryStream = New MemoryStream(m.ToArray())
Return Pdfstream
|