What have you done today?

My thoughts on….

  • Today is…

    July 2007
    S M T W T F S
        Aug »
    1234567
    891011121314
    15161718192021
    22232425262728
    293031  
  • Archives

  • Current Class Schedule:

    Monday/Wednesday/Friday

    SPC 1016: Fundamentals Technical Presentations 1:30pm - 2:20pm

    MAC 2147: Mathematics for Calculus 2:30pm - 4:20pm (Fri: 2:30pm-3:20pm)


    Tuesday/Thursday

    COP 3223: C Programming 1:30pm - 2:45pm

    PSY 2012: General Psychology 6:00pm - 8:50pm (Tues. Only)

Coldfusion 8: More Inside

Posted by Will on July 12, 2007

Coldfusion is a type of application server and software development language used for the development of computer software, as well a dynamic web sites. Development is underway for the eighth version of Coldfusion, which has been codenamed:”Scorpio” and it is scheduled to be release by the second half of 2007.

As expected, Coldfusion 8 has brought to the table many new capabilities, which look to take this mature programming language to the next level. Something that stood out specifically during my research was the new <cfpdfform> and <cfdocument> tags. These new features will enable integration with Adobe PDF forms, as well as dynamic image manipulation functions.

After playing around with the tags, I have to admit that the amount of customization available for pdfs is unbelievable. I figured for now I cover a few new functions that Coldfusion 8 offers, and in the days coming, I’ll get further into the more powerful items.

First off, one of the wonderful new functions offer is the IsPDFFile function. Guess what it does? Thats right! It checks your supposed pdf file, and tells you if it really is a PDF.

<cfif isPDFFile("myPDF.pdf")<
   <cfset output1 = "Yes, this file is a PDF" />
<cfelse>
   <cfset output1 = "No, this file is not a PDF" />
</cfif>

<cfif isPDFFile("myTXT.txt")>
   <cfset output2 = "Yes, this file is a PDF" />
<cfelse>
   <cfset output2 = "No, this file is not a PDF" />
</cfif>

<cfoutput>
   #output1#
   #output2#
</cfoutput>

Above you see two different checks here. One of them is checking a .pdf file, and the other is checking a .txt file. Now when this is run, the output is:

“Yes, this file is a PDF”.
“No, this file is not a PDF”.

Thankfully, along with the many other new features, Coldfusion functions will now accept relative file paths. However, I believe that there may be instances where a relative path will not work, so you can use a full path if you want.

Taking this a step further, if you wanted contain a pdf file within a variable, Coldfusion introduces another function: isPDFObject.


<cfset fileName1 = "myPDF.pdf" />
<cfset fileName2 = "myTXT.txt" />

<cfif isPDFObject(fileName1)<
   <cfset output1 = "Yes, this file is a PDF" />
<cfelse>
   <cfset output1 = "No, this file is not a PDF" />
</cfif>

<cfif isPDFObject(fileName2)>
   <cfset output2 = "Yes, this file is a PDF" />
<cfelse>
   <cfset output2 = "No, this file is not a PDF" />
</cfif>

<cfoutput>
   #output1#
   #output2#
</cfoutput>

As last time, the output would generate the same response:
“Yes, this file is a PDF”.
“No, this file is not a PDF”.

Pretty easy when you think about. Now on to playing with the powerful <cfpdf> tag. I’ll post my research as soon as I’m done.

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>