Hello,
I am evaluating the trial version of Aspos.pdf and am having a bit of trouble. I would like to read in a pdf template file, fill out the form fields then stream the filled out pdf to the browser. Here is what I have so far based on another post:
Dim formfilename As String = "creditapp4.pdf"
Dim FormPath As String = Server.MapPath("~/CreditApp/PDFs/" + formfilename)
Dim fs As FileStream = File.OpenRead(FormPath)
Dim pdfForm As New Aspose.Pdf.Facades.Form(fs)
'FillPDFForm(pdfForm)
pdfForm.FillField("Company_Info", "XYZ Chevrolet")
Dim ms As New MemoryStream()
pdfForm.Save(ms)
fs.Close()
Response.Clear()
Response.ClearHeaders()
Response.ClearContent()
Response.Charset = "UTF-8"
Response.AddHeader("Content-Length", ms.Length.ToString())
Response.AddHeader("content-disposition", "inline; filename=" + "CreditApp.pdf")
Response.ContentType = "application/pdf"
Response.BinaryWrite(ms.ToArray())
Response.Flush()
Response.End()
The problems I am having are that in IE 11 the browser shows a blank page and the pdf is never rendered. In Firefox, the pdf is rendered in the browser but the form field is not filled in. What am I doing wrong?
Thanks.
Charles
I am evaluating the trial version of Aspos.pdf and am having a bit of trouble. I would like to read in a pdf template file, fill out the form fields then stream the filled out pdf to the browser. Here is what I have so far based on another post:
Dim formfilename As String = "creditapp4.pdf"
Dim FormPath As String = Server.MapPath("~/CreditApp/PDFs/" + formfilename)
Dim fs As FileStream = File.OpenRead(FormPath)
Dim pdfForm As New Aspose.Pdf.Facades.Form(fs)
'FillPDFForm(pdfForm)
pdfForm.FillField("Company_Info", "XYZ Chevrolet")
Dim ms As New MemoryStream()
pdfForm.Save(ms)
fs.Close()
Response.Clear()
Response.ClearHeaders()
Response.ClearContent()
Response.Charset = "UTF-8"
Response.AddHeader("Content-Length", ms.Length.ToString())
Response.AddHeader("content-disposition", "inline; filename=" + "CreditApp.pdf")
Response.ContentType = "application/pdf"
Response.BinaryWrite(ms.ToArray())
Response.Flush()
Response.End()
The problems I am having are that in IE 11 the browser shows a blank page and the pdf is never rendered. In Firefox, the pdf is rendered in the browser but the form field is not filled in. What am I doing wrong?
Thanks.
Charles