Join me online to learn about Adobe Flex 2, and how ColdFusion and Flex have been designed to work seamlessly together. ColdFusion productivity and simplicity on the back-end, coupled with Flex-generated rich and engaging Flash on the client-side, empowers you to build better and richer applications than ever before. I'll be presenting this Breezo August 2nd at 1:00 pm Eastern. Registration required
The new Voice Of America site has been launched, consisting of sub-sites serving content in 44 different languages, and handling over 2,000,000 unique visitors and 120,000,000 hits each month. The original site was Spectra based, but the new site is powered by PaperThin's CommonSpot running on top of ColdFusion MX. Over 1/4 million pages of content were migrated from the old system to the new one, and our pals over at Fig Leaf worked on the implementation and wrote custom extensions. For more details see the press release. Congrats to PaperThin and Fig Leaf on this impressive accomplishment!
The MAX 2006 attendee rate at The Venetian Hotel is $219/night, much cheaper than the $499/night you'll pay without the MAX discount. So, if you do plan on staying at The Venetian Hotel, you may want to register soon. Hotel details are on the MAX 2006 Hotel and Travel page.
The ability to programmatically access and manipulate PDF forms from within ColdFusion has been requested since, well, since we first demonstrated PDF generation abilities in ColdFusion MX 7. At CFUNITED a few weeks ago, Jason Delmore (ColdFusion Product Manager) demonstrated a planned ColdFusion "Scorpio" tag named <cfpdfform> which he used to populate (pre-fill) and extract values from a PDF form.
Scorpio is scheduled to be released in 2007. So what to do if you need PDF form support in ColdFusion right now? Well, here's a solution:
Adobe has a Java API named XPAAJ (which stands for XML/PDF Access API for Java). The API can be used to:
- Extract and insert PDF form field data.
- Convert PDF documents to XDP format.
- Access PDF metadata and file attachments.
- Add, replace, and delete embedded data objects, file attachments, and annotations.
- Obtain PDF file properties.
- ... and more.
Until a few days ago the XPAAJ license restricted use of the API to customers with licensed copies of LiveCycle servers. But that license has been updated to include other Adobe servers, including ColdFusion. As such, if you have a licensed copy of ColdFusion you may register and download XPAAJ and use it with ColdFusion.
Of course, using XPAAJ from within CFML code requires writing ColdFusion Java code. And so, to make life easier for us CFers, I wrote a Custom tag named <cf_pdfform> which makes it really easy to get and set PDF form field values. Want to pre-fill a PDF form? You can use this code:
<!--- PDF form --->
<cfset pdfForm=ExpandPath("Grant Application.pdf")>
<!--- Output PDF name --->
<cfset pdfResult=ExpandPath("Grant Application Filled.pdf")>
<!--- Generate filled in form --->
<cf_pdfform action="set"
form="#pdfForm#"
destination="#pdfResult#">
<cf_pdfformparam name="ProjectTitle" value="My Project">
<cf_pdfformparam name="RequestNum" value="1234567890">
<cf_pdfformparam name="RequestTitle" value="Widget Study">
</cf_pdfform>
Extracting PDF form field values is just as easy:
<!--- Output PDF name --->
<cfset pdfResult=ExpandPath("Grant Application Filled.pdf")>
<!--- Get field data --->
<cf_pdfform action="get"
form="#pdfResult#"
result="fields">
<!--- Dump it --->
<cfdump var="#fields#">
<cf_pdfform> is not as powerful or capable as Scorpio's planned <cfpdfform> tag family, but it'll help you in the interim.
To use <cf_pdfform> you must download and install XPAAJ.jar from the LiveCycle Developer Center XPAAJ page (you will need to register and accept the license before doing so). XPAAJ comes with extensive documentation and examples (none of which are actually needed to use <cf_pdfform>, although if you want to use XPAAJ to do more, this is all of the documentation you'll need). Then you'll need the attached ZIP file (see the download link below) which contains the <cf_pdfform> Custom Tag, documentation, and a CFML example.
Enjoy!