Here is an example that I put together from other examples of populating an
fdf file using cf. This is not exactly what you were asking for but this is
something that I have working. The other issue with ie 5.5+ browsers in
regards to your problem with the file open is the url must have something
after the file name like
http://yoururl/pdfcreate.cfm/usefulordummy=something or
http://yoururl/pdfcreate.cfm?debug=false as part of the url or you end up
with the problem you described. Even with the <CFHEADER
NAME="Content-Disposition" VALUE="inline; filename=rptTranscript3.fdf"> code
in your cf file does not totally solve the problem. I ran into this same
problem serving comma separated value files to users and kept getting the
file open/save dialog in ie 5.5+ browsers and here is the code I ended up
with
example 1 - serving generated csv files to excel
===============javascript from calling browser page start===================
<a href="blocks/dsp_mem_export_link.cfm/#listlast(newfile,"\")#">here</a>
===============javascript from calling browser page end===================
the /something is necessary after the dsp_mem_export_link.cfm to work
around the file open/save problem. In this case I used the filename of the
comma value file in the url to know which file was generated as a link in
the returned page.
===============cf file start===================
<cfset filenme=mid(cgi.path_info,find(".cfm/",cgi.path_info)+5,20)>
<cfheader name="Content-Disposition" value="filename=#filenme#">
<cfcontent type="application/ms-excel"
file="#request.sitedir#\#request.sitewrkdir#\#filenme#">
===============cf file end===================
example 2 - populating fdf files
===============javascript from calling browser page start===================
This is the javascript that calls the cf file
function vwtrans(uid)
{pathstr="#request.root##request.appdir#/external/testpdf.cfm?debug=false&ui
d="+uid
popup=uniWinNamed(pathstr,'yes','no','no','500','440','vwtrans','y','no','no
','yes');
};
===============javascript from calling browser page end===================
===============fdf file start===================
<cfoutput>
%FDF-1.2
%����
1 0 obj
<<
/FDF << /Fields [ << /V (#issuedate#)/T (issuedate)>> << /V (#mhistory#)/T
(mhistory)>>
<< /V (#mname#)/T (mname)>> << /V (#mnumber#)/T (mnumber)>> << /V
(#mpage#)/T (mpage)>>
]
/F (http://url/your.pdf)/ID [
<88da31f64c13bdf39780da937320a59e><2d4b3446687a57d78fc03891ec08072b>
] >>
>>
endobj
trailer
<<
/Root 1 0 R
>>
%%EOF
</cfoutput>
===============fdf file end===================
===============cf file start==================
<CFSETTING ENABLECFOUTPUTONLY="YES">
<!--- returnPDF.cfm, example/test code.
Returns an Adobe FDF file to the browser. The FDF file contains
form value
data and a pointer to a template PDF file. The FDF file being used is
called
myForm.fdf. The end result is that the PDF template is displayed to the
user using
the form data dynamically populated in the FDF file.
See <http://partners.adobe.com/asn/developer/acrosdk/forms.html> for
more
information of Adobe's FDF format.
--->
<!--- Set a debug flag. A value of 1 will help debug the FDF file if
necessary. --->
<CFPARAM NAME="URL.Debug" DEFAULT="0">
<!--- Set values for the variables used in myForm.fdf.
This could also be a query or whatever. --->
<CFSET variables.To = "[EMAIL PROTECTED]">
<CFSET variables.Body = "This is some text (for) the body of the message.">
<!--- Need to escape any parenthesis using the backslash
(the parenthesis are used as control characters in FDF).
This step is only necessary if your values might contain '(' or ')'
characters. --->
<CFSET variables.Body = ReplaceList( variables.Body, "(,)", "\(,\)" )>
<cfquery name="na" datasource="na">
select * from table where columnname=value
</cfquery>
<cfset mname="#member.title# #member.fname# #member.lname#">
<cfset mnumber=member.summer>
<cfset issuedate=dateformat(now(),'dd/mm/yy')>
<cfset mpage="1">
<cfquery name="training" datasource="fwtr">
select coursename,datetaken,descrip
from mod_mem_trainhist
where memid=#url.uid#
order by trainid
</cfquery>
<cfset trainhist="">
<cfloop query="training">
<cfset trainhist=trainhist&coursename&datetaken&descrip&chr(10)&chr(13)>
</cfloop>
<cfset mhistory=trainhist>
<!--- If debug is not on, specify the file name and content type for the
browser --->
<CFIF NOT URL.Debug>
<CFHEADER NAME="Content-Disposition" VALUE="inline;
filename=rptTranscript3.fdf">
<CFCONTENT TYPE="application/vnd.fdf">
</CFIF>
<!--- Avoid any white space before the actual content is sent.
A leading blank line will cause an Acrobat error. --->
<CFSETTING ENABLECFOUTPUTONLY="NO"><CFINCLUDE TEMPLATE="rptTranscript3.fdf">
===============cf file end==================
Hope this helps.
Gary Bonde
[EMAIL PROTECTED]
Web/DB Analyst
CECGeo Group
www.cecgeo.org
-
You are subscribed to the CFUGToronto CFTALK ListSRV.
This message has been posted by: "Gary Bonde" <[EMAIL PROTECTED]>
To Unsubscribe, Please Visit and Login to http://www.CFUGToronto.org/
Manager: Kevin Towes ([EMAIL PROTECTED]) http://www.CFUGToronto.org/
This System has been donated by Infopreneur, Inc.
(http://www.infopreneur.net)