我正在尝试合并我用 cfthread 创建的一系列 pdf 文件。我正在使用以下代码:
<cfquery name="data">
select * from mytable
</cfquery>
<cfset threadList = "">
<cfloop index="x" from="1" to="#data.recordcount#">
<cfset name = "threadnumber#x#">
<cfset threadList = listAppend(threadList,name)>
<cfthread name="#name#">
<cfloop query="data">
<cfpdf action="read" name="myPDF#randrange(1,1000)#" source="#Expandpath('/_pdf/#data.cusip#.pdf')#" />
</cfloop>
</cfthread>
</cfloop>
<cfthread action="join" name="#threadlist#" />
<cfpdf action="merge" name="final">
<cfloop list="#threadlist#" index="i">
<cfloop query="data">
<cfpdfparam source="#Expandpath('/_pdf/#data.cusip#.pdf')#">
</cfloop>
</cfloop>
</cfpdf>
但是,我收到这样的错误:
Error casting an object of type com.adobe.internal.pdftoolkit.core.types.ASString cannot be cast to [B to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed.
com.adobe.internal.pdftoolkit.core.types.ASString cannot be cast to [B
The error occurred in D:/inetpub/wwwroot/project1/schedulefocuslist.cfm: line 77
75 : <cfloop list="#threadlist#" index="i">
76 : <cfloop query="data">
77 : <cfpdfparam source="#Expandpath('/_pdf/#data.cusip#.pdf')#">
78 : </cfloop>
79 : </cfloop>