Blog

Blog posts made on 11-Aug-06
11Aug
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!

Read More ›

11Aug
2006
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.

Read More ›

11Aug
2006
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.

view plain print about
1<!--- Uses XPAAJ to return info about a PDF file --->
2<cffunction name="GetPDFInfo" returntype="struct" access="public" output="no">
3    <cfargument name="PDFFile" type="string" required="yes">
4
5    <cfscript>
6    // Init all vars
7

8    var formIS="";
9    var PDFfactory="";
10    var PDFdoc="";
11    var formType="";
12    var attachments="";
13    var result=StructNew();
14
15    // PDF form input stream
16

17    formIS=CreateObject("java", "java.io.FileInputStream");
18    formIS.init(ARGUMENTS.PDFFile);
19
20    // Get PDF document object
21

22    PDFfactory=CreateObject("java", "com.adobe.pdf.PDFFactory");
23    PDFdoc=PDFfactory.openDocument(formIS);
24
25    // Get page count and version
26

27    result.pages=PDFdoc.getNumberOfPages();
28    result.version=PDFdoc.getVersion();
29
30    // Get formtype object
31

32    formType=PDFdoc.getFormType();    
33
34    // Determine type
35

36    if ((formType EQ FormType.XML_FORM)
37        OR (FormType EQ FormType.ACROFORM))
38        result.isform=TRUE;
39    else
40        result.isform=FALSE;
41
42    // Get attachments
43

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

47    if IsDefinedd("attachments") AND IsArray(attachments))
48        result.attachments=ArrayLen(attachments);
49    else
50        result.attachments=0;
51    
</cfscript>
52
53    <cfreturn result>
54</cffunction>

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

view plain print about
1<cfset PDFFile=ExpandPath("myPDFFile.pdf")>
2<cfdump var="#GetPDFInfo(PDFFile)#">

Obviously, XPAAJ must be present to use this UDF.

Read More ›