Expand my Community achievements bar.

problem loading PDF via ASP and FDF Toolkit

Avatar

Former Community Member
Using the toolkit and the following code to stuff values into the pdf. Staic field names are not a problem. Dynamic field names coming from an array does...



Getting an exception occurred error on

An exception occurred: 'objFDF.FDFSetValue'



'create the FDF 3rd party dll object

Set FDFAcX = Server.CreateObject("FDFApp.FDFApp")

Set objFDF = FDFAcX.FDFCreate



' SET THE FULL ABSOLUTE URL OF YOUR PDF FILE

'*****************************************************

objFDF.FDFSetFile Server.MapPath("/pdf/"& FormName)



' USE THE FDFSetValue METHOD TO POPULATE THE PDF's FORM FIELDS



'*********************************************************************

' PDF form field name, Value you want entered, a value used to

comply

' with Adobe Acrobat version 3.0 and below.

' objFDF.FDFSetValue "1_NAME_OF_CLAIMANT_Last_F", strName, False



for x = 0 to ubound(DataArray,1)

'replace the address commas (if ,,) with one single comma

if instr(DataArray(x,0),"address")>1 then DataArray(x,1) =

replace(DataArray(x,1),",,",",")



' response.write DataArray(x,0)&"::"& DataArray(x,1)&"

"

' response.write "objFDF.FDFSetValue "& DataArray(x,0) & ", " &

DataArray(x,1)& ", False

":response.flush

objFDF.FDFSetValue DataArray(x,0), DataArray(x,1), False

next



Please help me.....aaahhhhhhhhhhhhhh!
2 Replies

Avatar

Former Community Member
Hi Bastien

Sorry to say I have no solution

but it is interesting so please mail me if you find a solution

ulf.a@dtp-tjanst.se

Avatar

Former Community Member
I need to fill a PDF form via ASP.Net and the FDF Toolkit. I found the ASp.Net code to do it but the form fields do not get populated. I am wondering if I need to do something to the document in Designer to allow this.



Here is my dotNet code



Dim FdfApp As New FdfAppClass()

Dim FdfAcX_Doc As FdfDoc

FdfAcX_Doc = FdfApp.FDFCreate

FdfAcX_Doc.FDFSetFile("C:\Documents and Settings\me\My Documents\Visual Studio 2005\OSP\test1149.PDF")

FdfAcX_Doc.FDFSetValue("B1_From_Address", " This is my very own test ", False)



FdfAcX_Doc.FDFSaveToFile("C:\Documents and Settings\me\My Documents\Visual Studio 2005\OSP\test.fdf")

FdfAcX_Doc.FDFClose()

Response.ContentType = "Application/vnd.fdf"

Response.WriteFile("C:\Documents and Settings\me\My Documents\Visual Studio 2005\OSP\test.fdf")

Response.End()



George