Need to add a PDF - Know nothing about coldfusion,

  • (2 Pages)
  • +
  • 1
  • 2

23 Replies - 4438 Views - Last Post: 05 August 2014 - 10:43 AM Rate Topic: -----

#1 nikc121  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 133
  • Joined: 12-April 10

Need to add a PDF - Know nothing about coldfusion,

Posted 30 July 2014 - 03:40 PM

I am helping a friend maintain a website that was written in cold fusion.(until we can find someone that knows coldfusion) She wants me to a pdf that when clicked on will open in a new window. I added it to the page the same way I would if it was a html file but, but obviously its not working becasue its a .cfm. I just need something simple that I can understand. Any help at all would be great.
<div id="maincontent">

 

<table>
		<tr>
			<td style="vertical-align:top">
				 <div id="contentBox" style="text-align:center">
					<h1 class="pageHeader">On and Offsite Parties</h1>
					
					<b>On Location</b><br>
					Studio Cellar is a great place to not only have date night, girls night or solo night, but is the ideal location for your wedding festivities, corporate meetings, holiday parties, birthday parties, wine tasting gatherings, photo shoots, meetings, team building, fashion shows, launch parties and other special occasions.  Book on location parties through our calendar tab or call in for inquires on event bookings. We will accommodate for your party times if we can.
                    					<br><br>
                                        
                    <b>Please review our <a href="RAW/VenueContract.pdf" target="_new">Event Space Rental Agreement and Contract</a> for more information.
                    <br /><br />
					<font style="font-size:10pt">Street parking for Studio Cellar is available for free after 5:00pm. In walking distance, located at the corner of Washington and Lincoln Streets the parking garage offers the first hour free to cash customers and a special evening maximum rate of $3. for anyone entering the garage after 5 p.m. and exiting before 2 a.m. Parking in other business designated areas is at the drivers risk of getting towed.</a> 
					</font>


Is This A Good Question/Topic? 0
  • +

Replies To: Need to add a PDF - Know nothing about coldfusion,

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 30 July 2014 - 03:54 PM

Hi and welcome to DIC, nikc121!

This isn't a CFML question so much as it is an HTML question.

To get the link to the .pdf file to fire into a new window you can do something more complex with a call to a Javascript function that explicitly calls a new window OR you can just change the target attribute of the anchor tag tag from "_new" to "_blank".

Try the second alternative first and see if that gets you where you want want to be.

If you have more CF questions feel free to post them here.

Good luck!
Was This Post Helpful? 0
  • +
  • -

#3 nikc121  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 133
  • Joined: 12-April 10

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 30 July 2014 - 04:16 PM

tired the _blank But got this
The web site you are accessing has experienced an unexpected error.
Please contact the website administrator.

The following information is meant for the website developer for debugging purposes.
Error Occurred While Processing Request
Could not find the included template RAW/VenueContract.pdf.cfm.
Note: If you wish to use an absolute template path (for example, template="/mypath/index.cfm") with CFINCLUDE, you must create a mapping for the path using the ColdFusion Administrator. Or, you can use per-application settings to specify mappings specific to this application by specifying a mappings struct to THIS.mappings in Application.cfc.
Using relative paths (for example, template="index.cfm" or template="../index.cfm") does not require the creation of any special mappings. It is therefore recommended that you use relative paths with CFINCLUDE whenever possible.

The error occurred in D:/home/studio-cellar.com/wwwroot/index.cfm: line 14

12 :
13 :
14 : <cfinclude template="#page#.cfm">
15 :
16 :
Was This Post Helpful? 0
  • +
  • -

#4 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 30 July 2014 - 04:46 PM

Oh. Okay. That is an error that means the .pdf doesn't exist in the directory you specified.

To fix it you just need to make sure the file is in that folder on the server.
Was This Post Helpful? 0
  • +
  • -

#5 nikc121  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 133
  • Joined: 12-April 10

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 30 July 2014 - 04:52 PM

Yes the file is in that folder. I think it has something to do with the cold fusion coding, Its not recognizing the file .pdf. I even tried to put the .pdf file in the image folder and pulled it from there, but received the same error.
Was This Post Helpful? 0
  • +
  • -

#6 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 31 July 2014 - 05:48 AM

I could be wrong about this, but the file that you are trying to access ends in ".pdf.cfm".

Is the .cfm page just an include to the actual PDF file??

A cross-browser solution is probably going to be difficult, as not only is each browser different, but you also have to consider if the browser has the PDF plugin, and what instructions the browser is given to do with the PDF (open in a browser window, open in the Reader executable, download.)

V/r,

^_^

This post has been edited by _WolfShade_: 31 July 2014 - 05:50 AM

Was This Post Helpful? 0
  • +
  • -

#7 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 31 July 2014 - 05:59 AM

Indeed. Sorry about that. I looked at that message on my cell and didn't even see the code example.

The error you mentioned isn't the same as the original code you posted. There was no cfinclude in your original post (the one where you asked how to get a .pdf to fire into a new window when the link to it is clicked). The error is a different animal altogether and appears to be unrelated.

As _wolfshade_ mentioned, you're appending a ".cfm" to whatever the variable for "page" contains. If that is supposed to be the file name and/or path to the .pdf then doing it via an include won't work.

Perhaps we need to start over from the beginning. Tell us now what kind of issue you're having, if there is an error please supply the pertinent details of the error message and, if possible, include the code page for where the error message is telling you the error resides.

We'll see what we can do.

And once you are looking for someone who knows CF, mention it here as well.

This post has been edited by Craig328: 31 July 2014 - 06:00 AM

Was This Post Helpful? 0
  • +
  • -

#8 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 31 July 2014 - 06:36 AM

The one time that I've worked with PDFs, I use CFFILE to read the PDF into a binary, then use CFHEADER and CFCONTENT to display the file inline. A minor tweak to this might allow you to open in a new window.

<cffile action="readBinary" file="#dirPath##fileName#" variable="thisPDF" />
<cfheader name="Content-Disposition" value="inline; filename=""#fileName#""" />
<cfheader name="Expires" value="#now()#" />
<cfcontent type="application/pdf" variable="#thisPDF#" />



V/r,

^_^
Was This Post Helpful? 0
  • +
  • -

#9 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 31 July 2014 - 06:51 AM

That would work fine on a destination page of a link click. It'd have to be a .cfm that gets clicked to which in turn embeds the .pdf into a page.
Was This Post Helpful? 0
  • +
  • -

#10 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 31 July 2014 - 06:55 AM

View PostCraig328, on 31 July 2014 - 08:51 AM, said:

That would work fine on a destination page of a link click. It'd have to be a .cfm that gets clicked to which in turn embeds the .pdf into a page.

Which would bring us back to your suggestion of using Javascript to open the .cfm page in a new window. :)
Was This Post Helpful? 0
  • +
  • -

#11 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 2024
  • View blog
  • Posts: 3,609
  • Joined: 13-January 08

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 31 July 2014 - 06:59 AM

Indeed it would.

I'm wanting to keep this simpler pending what the OP comes back with.
Was This Post Helpful? 0
  • +
  • -

#12 nikc121  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 133
  • Joined: 12-April 10

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 05 August 2014 - 06:36 AM

Ok now I am really confused. Sorry havent responded, was out of town for a couple of days. Back to work on this today.

The website was written in coldfusion. I was just trying to add a .pdf file. And not the pdf file does not end in .pdf.cfm. Im not sure how to do that. The problem is the person who designed the website quite. So we are tying to find someone that can help with things like this.

I just need to add a pdf into the page.
This is the page I want to add it to code.

<div id="maincontent">

 

<table>
		<tr>
			<td style="vertical-align:top">
				 <div id="contentBox" style="text-align:center">
					<h1 class="pageHeader">On and Offsite Parties</h1>
					
					<b>On Location</b><br>
					Studio Cellar is a great place to not only have date night, girls night or solo night, but is the ideal location for your wedding festivities, corporate meetings, holiday parties, birthday parties, wine tasting gatherings, photo shoots, meetings, team building, fashion shows, launch parties and other special occasions.  Book on location parties through our calendar tab or call (803)446-0709 or email <a href="mailto:[email protected]">[email protected]</a> for inquires on event bookings.<br /> We will accommodate for your party times if we can.<br />
                  <!--Please review our <a href="VenueContract.pdf" target="_blank">Event Space Rental Agreement And Contract</a>for more information.-->
                    <br /><br />
					<font style="font-size:10pt">Street parking for Studio Cellar is available for free after 5:00pm. In walking distance, located at the corner of Washington and Lincoln Streets the parking garage offers the first hour free to cash customers and a special evening maximum rate of $3. for anyone entering the garage after 5 p.m. and exiting before 2 a.m. Parking in other business designated areas is at the drivers risk of getting towed.</a> 
					</font>
					<br><br>
					<b>Off Site Art Parties</b><br>
					We provide a traveling service for parties held outside of the studio. We arrive with all art supplies, easels, paint, brushes, canvasses, aprons and provide the class painting party. Minimum of 10/party. All you have to provide is the right amount of tables, chairs, space to hold everyone, and your drinks of choice.
					<br><br>
                    
				   <img src="/images/parties.jpg" width="300px" style="float:left">
					<div style="text-align:left; margin-left:350px">
					<ul>
					<li>Anniversaries</li>
					<li>Birthdays</li>
					<li>Private Parties</li>
					<li>Sororities</li>
					<li>Bachelorette Parties</li>
					<li>Bridal Showers</li>
					<li>Baby Showers</li>
					<li>Family Gatherings</li>
					<li>Office Parties</li>
					<li>Theme Parties</li>
					</ul>
					</div>
					</div>
					
				</td>
			<td style="vertical-align:top; padding-left:20px">
			<img src="/images/parties1.jpg" width="300px"><br>
			<img src="/images/parties12.jpg" width="300px"><br>
			<img src="/images/parties8.jpg" width="300px"><br>
			
			</td>
		</tr>
	</table>
</div>


I just want to add a file .pdf where I hve it coded out <!-- -->
Was This Post Helpful? 0
  • +
  • -

#13 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 05 August 2014 - 07:36 AM

The commented out code, once uncommented, should open "VenueContract.pdf" in a new window. If this is not the case, what is it doing?
Was This Post Helpful? 0
  • +
  • -

#14 nikc121  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 133
  • Joined: 12-April 10

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 05 August 2014 - 07:49 AM

This page pops up

http://www.studio-ce...nueContract.pdf
Was This Post Helpful? 0
  • +
  • -

#15 _WolfShade_  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 60
  • Joined: 12-May 14

Re: Need to add a PDF - Know nothing about coldfusion,

Posted 05 August 2014 - 08:11 AM

According to your first post, this is the desired action (to open a PDF file in a new window.)

If the PDF is not in the same folder/directory as the .cfm page that is serving the code, then add that path to the href attribute of the anchor tag. (Your first post has the anchor href as "RAW/VenueContract.pdf". If the PDF is in a higher folder, then you would put "../VenueContract.pdf" as the href.)
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2