OK, here's the scenario: I have a client who needs to populate a PDF form (1098) using data from a database. Right now they have code that simply uses cfpdfform to output the finished "populated" PDF. Now, here's the problem, we would like to abstract this and create a pdf variable, outbound from a function call, that we can then cfcontent to the screen as a PDF. The docs indicate that you can create a pdf variable from a cfpdfform using cfdocument, however implementing it has been proven to be problematic. Is it just not possible to create a pdf variable from a cfpdfform embedded in a cfdocument? Creating a pdf file works fine, but we don't really need the physical file on the server, just the generated pdf output to the screen. Any suggestions?
Skip embedding and use cfsavecontent to capture the cfpdfform output in a variable.
<cfsavecontent >
<cfpdfform action="populate" ... (omit destination) ... >
</cfpdfform>
</cfsavecontent>
MercuryNewt wrote:
Is it just not possible to create a pdf variable from a cfpdfform embedded in a cfdocument?
Yes, you can. Though you need to use at least on cfdocumentsection and apparently it must be before the cfpdfform tags or it does not work. At least not in my tests.
I do not normally use embedding, but it did work for me as long as the cfdocumentsection was in the right place. But, it probably would not be a good solution for this case anyway, because cfdocumentsection adds a page break. So you would have a blank first page.
http://cfsearching.blogspot.com/2009/04/embedding-pdf-form-in-cfdocume nt.html
Hi Leigh,
When I run the following code (in CF8 & CF9), the cfsavecontent tag is ignored (output is written directly to browser):
<cfsavecontent variable="myVar">
<cfpdfform source="#expandPath('/path/to/MyPDF.pdf')#" action="populate" />
</cfsavecontent>
Just curious.. so the cfsavecontent tag was honored for you (output is trapped in variable, and not directly written to browser)?
Thanks!,
-Aaron Neff
UPDATE: It seems "name" is not actually a _documented_ attribute of cfpdfform (only cfpdf). Aaron mentioned this on another forum. If "name" really is undocumented/unsupported, I probably would not use it. The issue is mentioned in the bug database #75195. The current status is "Closed", but I do not know the final outcome (ie fixed/not-fixed.
http://cfbugs.adobe.com/cfbugreport/flexbugui/cfbugtracker/main.html#b ugId=75195
Just curious.. so the cfsavecontent tag was honored for you
(output is trapped in variable, and not directly written to browser)?
Hi Aaron,
I think that was just non-tested psuedo-code. (I am not sure why I did not just suggest using the "name" attribute to capture the output in a variable..) But that does work on CF9 ![]()
-Leigh
North America
Europe, Middle East and Africa
Asia Pacific
Copyright © 2012 Adobe Systems Incorporated. All rights reserved.
Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy (updated 07-14-2009).