I am using ActivePDF toolkit to generate a pdf document with form fields containing information obtained from a database. The code i have basically comes straight from their product documentation and looks like this:
set toolkit = CreateObject("APToolkit.Object"
r = toolkit.openoutputfile("MEMORY"
r=toolkit.newpage
r = toolkit.MergeFile("d:\dprweb\lic_app\deficiency\defnotice3502b.pdf",0,0)
toolkit.CloseOutputFile
x = toolkit.OutputBytestream()
r = toolkit.OpenOutputFile("output.pdf"
toolkit.InputByteStream = x
r = toolkit.OpenInputFile("MEMORY"
toolkit.SetFormFieldData "Name",Name,-998 'here is name
toolkit.SetFormFieldData "Address1",Address1,-998 'here is address1
toolkit.SetFormFieldData "Address2",Address2,-998 'here is address2
toolkit.SetFormFieldData "Address3",Address3,-998 'here is address3
toolkit.SetFormFieldData "Liaison",Liaison,-988 'here is liaison
toolkit.SetFormFieldData "LEmail",LEmail & ".",-998 'here is liaison
toolkit.SetFormFieldData "Pro_name",Pro_name,-998 'here is profession
'set up loop to display deficiencies
count = 0
do while not rstdefc.EOF
count = count + 1
description_text=trim(rstdefc("description_text")
charlength = len(description_text)
histcomment=rstdefc("histcomment"
if mid(description_text,charlength,1) = "." then
Description = description_text & " " & histcomment
else
if mid(description_text,charlength,1) = "$" then
Description = description_text & " " & histcomment
else
if mid(description_text,charlength,1) = "#" then
Description = description_text & " " & histcomment
else
if mid(description_text,charlength,1) = ":" then
Description = description_text & " " & histcomment
else
Description = description_text & " " & histcomment
end if
end if
end if
end if
toolkit.SetFormFieldData "Description_Text" & cstr(count),Description,-998
rstdefc.MoveNext
loop
r = toolkit.copyform(0,0)
toolkit.CloseOutputFile
set toolkit=nothing
It appears as though the document is being generated but it is not viewable when i use this HREF statement for the viewer to click on and view the document:
Response.Write("<a href =" & x & "><b>Click to view and print Deficiency letter.</b></a> "
What happens in the browser is that a bunch of numbers and possibly ascii coding appears in the area where you would have the viewer click to view the pdf.
Has anyone else experienced this problem when trying to generate a pdf document from memory using activePDF toolkit?
tia,
set toolkit = CreateObject("APToolkit.Object"
r = toolkit.openoutputfile("MEMORY"
r=toolkit.newpage
r = toolkit.MergeFile("d:\dprweb\lic_app\deficiency\defnotice3502b.pdf",0,0)
toolkit.CloseOutputFile
x = toolkit.OutputBytestream()
r = toolkit.OpenOutputFile("output.pdf"
toolkit.InputByteStream = x
r = toolkit.OpenInputFile("MEMORY"
toolkit.SetFormFieldData "Name",Name,-998 'here is name
toolkit.SetFormFieldData "Address1",Address1,-998 'here is address1
toolkit.SetFormFieldData "Address2",Address2,-998 'here is address2
toolkit.SetFormFieldData "Address3",Address3,-998 'here is address3
toolkit.SetFormFieldData "Liaison",Liaison,-988 'here is liaison
toolkit.SetFormFieldData "LEmail",LEmail & ".",-998 'here is liaison
toolkit.SetFormFieldData "Pro_name",Pro_name,-998 'here is profession
'set up loop to display deficiencies
count = 0
do while not rstdefc.EOF
count = count + 1
description_text=trim(rstdefc("description_text")
charlength = len(description_text)
histcomment=rstdefc("histcomment"
if mid(description_text,charlength,1) = "." then
Description = description_text & " " & histcomment
else
if mid(description_text,charlength,1) = "$" then
Description = description_text & " " & histcomment
else
if mid(description_text,charlength,1) = "#" then
Description = description_text & " " & histcomment
else
if mid(description_text,charlength,1) = ":" then
Description = description_text & " " & histcomment
else
Description = description_text & " " & histcomment
end if
end if
end if
end if
toolkit.SetFormFieldData "Description_Text" & cstr(count),Description,-998
rstdefc.MoveNext
loop
r = toolkit.copyform(0,0)
toolkit.CloseOutputFile
set toolkit=nothing
It appears as though the document is being generated but it is not viewable when i use this HREF statement for the viewer to click on and view the document:
Response.Write("<a href =" & x & "><b>Click to view and print Deficiency letter.</b></a> "
What happens in the browser is that a bunch of numbers and possibly ascii coding appears in the area where you would have the viewer click to view the pdf.
Has anyone else experienced this problem when trying to generate a pdf document from memory using activePDF toolkit?
tia,