Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

download PDF

Status
Not open for further replies.

yuchieh

MIS
Jul 21, 2000
178
US
We are using ActivePDF and <cfobject> to create the dynamic PDF files.

In the form page, a link
<a href=&quot;downloadref.cfm? ControlNum=#getreflist.controlNumber#&quot; target=&quot;_blank&quot;>Download Form</a>

Then in downloadref.cfm page, create the PDF file

<cfquery datasource=&quot;#DSN#&quot; name=&quot;getupdate&quot;>
select *
FROM refEval
WHERE controlNumber = '#url.controlNum#'
</cfquery>

<cfoutput>

<cfobject type=&quot;COM&quot;
name=&quot;PDF&quot;
class=&quot;APToolkit.Object&quot;
action=&quot;CREATE&quot;>

<CFSCRIPT>
lastname = #lastname#;
firstname = #firstname#;
discipline = #discipline#;
name = #refname#;
title = #getupdate.Title#;
department = #getupdate.Department#;
institution = #getupdate.institution#;
email = #getupdate.Email#;
r = PDF.OpenOutputFile(ExpandPath(&quot;referenceforms/reference#controlnumber#.pdf&quot;));
r = PDF.SetHeaderFont(&quot;Helvetica&quot;,10);
PDF.SetHeaderText(460,643,controlnumber);
r = PDF.SetHeaderFont(&quot;Helvetica&quot;,10);
PDF.SetHeaderText(62,643,lastname);
r = PDF.SetHeaderFont(&quot;Helvetica&quot;,10);
PDF.SetHeaderText(272,643,firstname);
r = PDF.SetHeaderFont(&quot;Helvetica&quot;,10);
PDF.SetHeaderText(150,625,discipline);
r = PDF.SetHeaderFont(&quot;Helvetica&quot;,10);
PDF.SetHeaderText(164,608,name);
r = PDF.SetHeaderFont(&quot;Helvetica&quot;,10);
PDF.SetHeaderText(423,608,institution);
r = PDF.SetHeaderFont(&quot;Helvetica&quot;,10);
PDF.SetHeaderText(158,590,title);
r = PDF.SetHeaderFont(&quot;Helvetica&quot;,10);
PDF.SetHeaderText(428,590,department);

x = PDF.MergeFile(ExpandPath(&quot;reference.pdf&quot;),1,1);
PDF.CloseOutputFile();
</CFSCRIPT>

<cflocation url=&quot;referenceforms/reference#controlnumber#.pdf&quot; addtoken=&quot;No&quot;>

</cfoutput>

It was working last week. I could open the PDF file directly from the browser fine by clicking on the link. Then suddenly, it doesn't work anymore. When I click on the download form link, a window pops up and asks if I want to open or save the file. Choose either one, I get an error &quot;Internet Explorer was not able to open this internet site....&quot;

Not sure what's going on or what caused it. Please help!!

Thanks

 
Not too sure, but I noticed that there was a space between ? and ControlNum -- could that be causing the problem?

<a href=&quot;downloadref.cfm? ControlNum=#getreflist.controlNumber#&quot; target=&quot;_blank&quot;>Download Form</a>
 
I found it's the local browser problem. Because the download was working on Netscape and Mozilla when it's not working on IE. Now it works on IE again. I haven't pin-pointed the actual cause yet. I don't think I have any particular security settings on my IE. who knows.

Thanks for the reply.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top