Solved

Using cfcontent and cfx_pdf tags

Posted on 2004-08-18
1
583 Views
Last Modified: 2013-12-24
Try as I may I cannot for the life of me get my code to work. Whats worse is that I got this to work a few months ago but accidentally deleted the code and now I cant get it to work again. Heres the code

<html>
<head>
<title>page</title>
</head>

<cfoutput>
<cf_pdf file="cert.pdf" allowprinting="true" allowcopy="false" allowmodify="false">
<cf_pdf_page size="LETTER">
<cf_pdf_image x="35" y="690" file="ft-letterhead.jpg">
</cf_pdf_page>
</cf_pdf>
</cfoutput>

<cfcontent type="application/pdf"
deletefile="yes"
file="C:\websites\tx4x4f\database\cert.pdf">


<body>
<a href="cert.pdf">Here</a>1

</body>

</html>

The problem is that the pdf wont open. The pdf generates fine without the use of the cfcontent. I cant see the problem with my use of the tag though.

I have played with every combination of the code and I know that its something thats really simple but I think I've been staring at this page way too long. Maybe a fresh set of eyes can help.

Thanks
-Jamaal
0
Comment
Question by:jackassery
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 35

Accepted Solution

by:
mrichmon earned 125 total points
ID: 11835270
You cannot have other things on the page when using cfcontent.

So you need to remove :

<body>
<a href="cert.pdf">Here</a>1

</body>

</html>

etc.


Your page should look like :

<cfoutput>
<cf_pdf file="cert.pdf" allowprinting="true" allowcopy="false" allowmodify="false">
<cf_pdf_page size="LETTER">
<cf_pdf_image x="35" y="690" file="ft-letterhead.jpg">
</cf_pdf_page>
</cf_pdf>
</cfoutput>

<cfcontent type="application/pdf"
deletefile="yes"
file="C:\websites\tx4x4f\database\cert.pdf">
0

Featured Post

What Is Blockchain Technology?

Blockchain is a technology that underpins the success of Bitcoin and other digital currencies, but it has uses far beyond finance. Learn how blockchain works and why it is proving disruptive to other areas of IT.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question