Wednesday, February 08, 2012    
Home My Books Blog ColdFusion About Me Back    

Calendar
<< Aug 2006 >>
S M T W T F S
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

Search

Categories
 • Acrobat (5) [RSS]
 • Adobe (110) [RSS]
 • AdobeMAX06 (45) [RSS]
 • AdobeMAX07 (59) [RSS]
 • AdobeMAX08 (66) [RSS]
 • AdobeMAX09 (39) [RSS]
 • AdobeMAX10 (34) [RSS]
 • AdobeMAX11 (27) [RSS]
 • AIR (297) [RSS]
 • Appearances (217) [RSS]
 • Books (86) [RSS]
 • CFEclipse (15) [RSS]
 • Cloud (1) [RSS]
 • ColdFusion (1477) [RSS]
 • ColdFusion Builder (22) [RSS]
 • Data Services (42) [RSS]
 • Fish Tank (5) [RSS]
 • Flash (356) [RSS]
 • Flex (562) [RSS]
 • Home Automation (5) [RSS]
 • HTML5 (22) [RSS]
 • JavaScript (2) [RSS]
 • Jobs (130) [RSS]
 • jQuery (14) [RSS]
 • JRun (14) [RSS]
 • Labs (62) [RSS]
 • LiveCycle (37) [RSS]
 • MAX (284) [RSS]
 • Mobile (239) [RSS]
 • Regular Expressions (19) [RSS]
 • RIA (21) [RSS]
 • SQL (45) [RSS]
 • Stuff (554) [RSS]
 • Tips (CF Studio) (80) [RSS]
 • Tips (CF) (795) [RSS]
 • Tips (Dreamweaver) (91) [RSS]
 • Tips (Flex Builder) (2) [RSS]
 • Using CF (167) [RSS]

Other BLOGs
 • Charlie Arehart
 • Lee Brimelow
 • Ray Camden
 • Christophe Coenraets
 • Sean Corfield
 • Mihai Corlan
 • Cornel Creanga
 • Mark Doherty
 • John Dowdell
 • Danny Dura
 • Enrique Duvos
 • Steven Erat
 • Kevin Hoyt
 • Serge Jespers
 • Adam Lehman
 • Duane Nickull
 • Miti Pricope
 • Andrew Shorten
 • Ryan Stewart
 • James Ward
 • Greg Wilson
 • Full As A Goog

RSS Feeds
 • Feed
 • Subscribe

Join my mailing list and find out about new books and other topics of interest.

Thoughts, ideas, tips, musings, and pontifications (not necessarily in that order) by Ben Forta ...
NOTE: This is my personal blog, and the opinions and statements voiced here are my own.

Viewing By Day : August 11, 2006 / Main
August 11, 2006

Matt Woodward Joining Senate Sergeant At Arms Team

I've known the folks at U.S. Senate Sergeant at Arms for quite a while, they are dedicated CF and Flex shop, and are a great group to spend time with. And now Matt Wooward has announced that he's joining them as Principal Information Technology Specialist. Congrats, Matt!


Special ColdFusion/Flex Promotion For U.S. Federal Customers

For a limited time, Adobe is offering two special RIA bundles exclusively for our federal government customers:

  • RIA Starter Package: Purchase ColdFusion MX 7.0.2 Enterprise and get a free copy of Flex Builder 2 with Charting (a $750 value) plus a free training certificate. Use the training certificate to attend a two hour training session that will show you how to use ColdFusion Extensions for Flex Builder 2 to quickly build data-driven Flex applications that connect to a ColdFusion server.
  • RIA Enterprise Edition: The complete RIA-in-a-Box - one copy ColdFusion MX 7.0.2 Enterprise, one 2CPU license of Flex Data Services 2 Departmental, 2 copies of Flex Builder 2 with Charting plus a free training certificate. Our discounted price for the complete RIA-in-a-Box is over 20% off the list price. Use the training certificate to attend a two hour training session that will provide details on ColdFusion/Flex integration with a focus on integrating ColdFusion with Flex Data Services (FDS).
This promotion is available through select resellers, and expires September 30, 2006. For more information, call us at 1-877-99-Adobe or contact our partner Carahsoft.


GetPDFInfo() UDF Returns PDF Information

A user wrote to ask how the recently released XPPAJ libraries (used in my cf_pdfform tag) could be used to determine basic PDF file information (version, page count, and so on). And yes, it sure can. The following is a quick UDF I threw together that returns PDF version, page count, attachment count, and a flag indicating whether or not the PDF contains a form.

<!--- Uses XPAAJ to return info about a PDF file --->
<cffunction name="GetPDFInfo" returntype="struct" access="public" output="no">
    <cfargument name="PDFFile" type="string" required="yes">

    <cfscript>
    // Init all vars

    var formIS="";
    var PDFfactory="";
    var PDFdoc="";
    var formType="";
    var attachments="";
    var result=StructNew();

    // PDF form input stream

    formIS=CreateObject("java", "java.io.FileInputStream");
    formIS.init(ARGUMENTS.PDFFile);

    // Get PDF document object

    PDFfactory=CreateObject("java", "com.adobe.pdf.PDFFactory");
    PDFdoc=PDFfactory.openDocument(formIS);

    // Get page count and version

    result.pages=PDFdoc.getNumberOfPages();
    result.version=PDFdoc.getVersion();

    // Get formtype object

    formType=PDFdoc.getFormType();    

    // Determine type

    if ((formType EQ FormType.XML_FORM)
        OR (FormType EQ FormType.ACROFORM))
        result.isform=TRUE;
    else
        result.isform=FALSE;

    // Get attachments

    attachments=PDFdoc.getFileAttachmentNames();
    // If have any, get count

    if (IsDefined("attachments") AND IsArray(attachments))
        result.attachments=ArrayLen(attachments);
    else
        result.attachments=0;
    
</cfscript>

    <cfreturn result>
</cffunction>

To use the UDF just pass it the fully qualified path to a PDF file, like this:

<cfset PDFFile=ExpandPath("myPDFFile.pdf")>
<cfdump var="#GetPDFInfo(PDFFile)#">

Obviously, XPAAJ must be present to use this UDF.

  © Copyright 1997-2009 Ben Forta, All Rights Reserved