Sunday, February 7, 2010

ColdFusion 9: CFPDFFORM (A Tag With No Name ?)

A question about saving the output of cfpdfform to a variable came up on the adobe forums recently. As I have been doing some testing with CF9 + CFPDF this week, I suggested using the name attribute. Well I was a bit surprised when someone casually mentioned that cfpdfform does not have a documented name attribute. Huh?


Scratching my head I checked the documentation and sure enough name was not one of the listed attributes. It is documented for cfpdf, but not cfpdfform. So I re-checked my code and the name attribute did work in simple tests.

<cfpdfform action="populate" source="c:\MyForm.pdf" name="pdfData">
    <cfpdfformparam name="name" value="Mark McCallan">
    <cfpdfformparam name="address" value="926 Data Avenue">
</cfpdfform>

<cfcontent type="application/pdf" variable="#ToBinary(pdfData)#" />

So I started to wonder if maybe it was just an omission in the documentation. I decided to try the highly unscientific method of using invalid attribute combinations. Just to see if the error messages would shed any light on the expected attributes. Granted it is probably not the most reliable indicator. But worth a shot.


Unfortunately the messages for some combinations suggest "name" is valid


While others seemed to side with the documentation.


A dump of the tag's class certainly seems to suggest support for a "name" attribute.


I was leaning towards a fluke in the documentation. But then I noticed a few issues with a LiveCycle form that had special rights enabled. When the pdf opened, Acrobat complained that the document was modified and disabled the special features.


So now I am thinking maybe it was not an omission in the documentation. Anyone have the real scoop on the "name" attribute?

0 comments:

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Header image adapted from atomicjeep