Hello,
I am trying to pre-fill an existing PDF file with form data process by an ASP file. Everything seems to work just fine until the file is supposed to be written to the screen. I then get a message saying that the file is damaged and cannot be repaired.
Here is my code to process the form data:
I was able to open the PDF file manually and it worked just great.
I am wondering if anyone else has come across this and if/how they were able to fix this.
Thanks so much.
J~
I am trying to pre-fill an existing PDF file with form data process by an ASP file. Everything seems to work just fine until the file is supposed to be written to the screen. I then get a message saying that the file is damaged and cannot be repaired.
Here is my code to process the form data:
Code:
'create pdf
set fdfAcx = server.createobject("FdfApp.FdfApp")
dim myFDF
set myFDF = fdfAcx.FDFCreate
myFDF.FDFSetFile "[URL unfurl="true"]http://localhost/exxon_initial.pdf"[/URL]
myFDF.FDFSetTargetFrame "AW_body"
empName = employee_name
svName = supervisor_name
compDate = Date()
comDate2 = Date()
myFDF.FDFSetValue "empName", empName, Off
myFDF.FDFSetValue "svName", svName, Off
myFDF.FDFSetValue "compDate", compDate, Off
myFDF.FDFSetValue "comDate2", comDate2, Off
myFDF.FDFSetStatus "Your Certificate has been created."
response.contenttype = "application/vnd.fdf"
response.binarywrite myFDF.FDFSaveToBuf
myFDF.FDFclose
set myFDF = nothing
set fdfAcx = nothing
I was able to open the PDF file manually and it worked just great.
I am wondering if anyone else has come across this and if/how they were able to fix this.
Thanks so much.
J~