Lucee 4.5.2 cfpdfparam difference with Adobe ColdFusion
Suppose the following on Lucee 4.5.2:
<cfset x = 1>
<cfdocument format="pdf" pagetype="A4" name="myVar#x#">
<cfdocumentsection>
Hi there
</cfdocumentsection>
</cfdocument>
<cfpdf action="merge" destination="RAM:///myPDF.pdf" overwrite="yes">
<cfpdfparam source="#evaluate("myVar#x#")#" />
</cfpdf>
<cfcontent file="RAM:///myPDF.pdf" type="application/pdf">
then to check it also runs on Adobe Cf; you'd actually end up with:
"ByteArray objects cannot be converted to strings."
The original code for Adobe CF ran with the paramater like so:
<cfpdfparam source="myVar#x#" />
Both sets of documentation list source defined as follows:
"Source PDF file to merge. You can specify a PDF variable, a cfdocument variable, or the pathname to a file."
This would indicate it is just a pointed type and that in Lucee it is not evaluating the string properly.
Just as an aside, while very messy, this will work:
<cfif server.coldfusion.productname eq "Lucee">
<cfpdfparam source="#evaluate("myVar#x#")#"">
<cfelse>
<cfpdfparam source="myVar#x#"">
</cfif>
As an aside, Lucee throws an error if the parameter syntax is like so:
<cfpdfparam source="#evaluate("myVar#x#")#""></cfpdfparam>
<cfset x = 1>
<cfdocument format="pdf" pagetype="A4" name="myVar#x#">
<cfdocumentsection>
Hi there
</cfdocumentsection>
</cfdocument>
<cfpdf action="merge" destination="RAM:///myPDF.pdf" overwrite="yes">
<cfpdfparam source="#evaluate("myVar#x#")#" />
</cfpdf>
<cfcontent file="RAM:///myPDF.pdf" type="application/pdf">
then to check it also runs on Adobe Cf; you'd actually end up with:
"ByteArray objects cannot be converted to strings."
The original code for Adobe CF ran with the paramater like so:
<cfpdfparam source="myVar#x#" />
Both sets of documentation list source defined as follows:
"Source PDF file to merge. You can specify a PDF variable, a cfdocument variable, or the pathname to a file."
This would indicate it is just a pointed type and that in Lucee it is not evaluating the string properly.
Just as an aside, while very messy, this will work:
<cfif server.coldfusion.productname eq "Lucee">
<cfpdfparam source="#evaluate("myVar#x#")#"">
<cfelse>
<cfpdfparam source="myVar#x#"">
</cfif>
As an aside, Lucee throws an error if the parameter syntax is like so:
<cfpdfparam source="#evaluate("myVar#x#")#""></cfpdfparam>
Comments
Post a Comment