Copy link to clipboard
Copied
I haven't had the chance to work with PDF with CF 8 and I'm not sure where to start.
I'm currently producing a report from a DB and I'm showing it in a table but I was just told to add a link where our user can click and get that same report in PDF. Users may want to share the report, keep the report, etc
I did some reading and a brief testing but still confuse. Should I use CFDOCUMENT tags with format attribute set to "pdf"? and what other attributes do I need for this task? When I ran mypdftest.cfm with the following codes, I got my pdf:
<cfdocument format="pdf">
Hello this is a test
</cfdocument>
but when I added a query on my second test and try to out put the result, I got my pdf but instead of showing the query result, I got strange characters
everywhere.
<cfdocument format="pdf">
<cfquery name="test" datasource="#application.dsn#">
Select * from some table where LastName = 'Allen'
</cfquery>
<table>
<tr>
<td>First Name</td>
<td>Last Name</td>
</tr>
<cfoutput query="test">
<tr>
<td>#FName#</td>
<td>#LName#</td>
</tr>
</cfoutput>
</table>
</cfdocument>
Can anyone help????
Copy link to clipboard
Copied
I get the strange characters from time to time during testing, but I have never seen it during production. When it happens, I change the format to something other than PDF, run the page, and then BACK to pdf and all is well. Not sure WHY that solves the issue, but it does.
Copy link to clipboard
Copied
Thank you! at least I know some other people had this experience.
I tried to run it again and this time I did not get those strange chars. But yesterday I tried it more than once. Adobe did not know about this???????