If I use the following code in my component:
<cfpdf action="merge" name="tender">
</cfpdf>
I get the following error:
Closing tag '' does not match the current parent item: 'cffunction'
However, if i change the code to:
<cfpdf action="merge" name="tender" />
I get no errors. Note that the only way I changed my code is the way I close the tag. Can anybody explain to me why that is and even better, tell me how to get around this?
The error is shown in CFEclipse in the "problems" view, but does not occur when I run the code on the server.
System setup: Win7, running Eclipse Indigo with CFEclipse v.1.4.3. Server runs Coldfusion 8.
Update 1:
If I simply ignore the parse error that CFEclipse shows and run the code on the server, it works as expected. I guess this suggest that it is indeed something with CFEclipse itself like Peter Boughton suggested, and not a problem in the code itself.
Just in case, here is the complete code for the function (note that this is not production code, I'm currently just testing in order to get the things I need working):
<cffunction name="GetTenderPDF" access="remote">
<cfargument name="Info" type="String" required="true" />
<cfset var Tender = {} />
<cfset var InfoJson = URLDecode(Arguments.Info) />
<cfif Not IsJSON(InfoJson)>
<cfreturn Error(Messages.NOT_JSON) />
</cfif>
<cfset Tender = DeserializeJSON(InfoJson) />
<cfset templatePath = "templates/tenderTemplate_"&Tender.GROUP&".cfm" />
<cfheader name="Content-Disposition" value="attachment; filename=offert.pdf" />
<cfdocument format="pdf" name="mydocument">
<cfloop index="x" from="1" to="15">
<p>
lorem upsom doloras paris hilton is my hero loreum ipsom dsoio foom an to dht end of the world
will anyone actually read this probably not but let me put more realtext in so it flows a bit nicely
<cfloop index="y" from="1" to="#randRange(1,9)#">This sentence will appear a random amount of time.</cfloop>
</p>
</cfloop>
</cfdocument>
<cfdocument format="pdf" name="base">
<cfinclude template="#templatePath#" />
</cfdocument>
<!--- <cfpdf action="merge" name="tender" /> --->
<cfpdf action="merge" name="tender">
<cfpdfparam source="base" />
<cfpdfparam source="mydocument" />
</cfpdf>
<cfcontent type="application/pdf" reset="true" variable="#toBinary(tender)#" />
</cffunction>