It seems that when I use the <cfsavecontent>
tag, the output of that is being served by the server (without the variable being outputted), which, to me, kind of defeats the purpose of <cfsavecontent>
.
If this is important: my application uses ColdSpring, ModelGlue and Transfer ORM.
Here's my example code in a function:
<cfsavecontent variable="testvar">
<cfinclude template="test.cfm" />
</cfsavecontent>
<cfreturn testvar>
And the template:
<cfdocument format="PDF" pagetype="A4" orientation="portrait" unit="cm">
<cfoutput>
<!--- PDF content here --->
</cfoutput>
</cfdocument>
The PDF content is being parsed by my browser (Google Chrome), while the view hasn't even been loaded in. How can I best prevent this from happening?
Just to clarify: I am not outputting the #testvar#
variable yet in this code, though it seems it loads the template in the browser anyways.
As I also needed to make multiple PDF documents merge, I ended up doing the following. Many thanks to Adam Cameron for providing the solution to my initial issue.
<cfdocument>
tag with the name
attribute to save the PDF in a variable (thanks to Adam Cameron for this)<cfpdf>
's merge
action, and using a cfloop, to loop over the array, inside it.<cfcontent>
and using the variable attribute with toBinary(myPdf)
This got me to where I am.