我有一个在 ColdFusion 中运行的图片库。我希望能够打印图像,而无需先生成 PDF。我相信这可以使用 CFEXECUTE 来完成。
基本上会有一个存储图像的会话,当单击继续按钮时,CFEXECUTE 将启动并使用 Windows 照片查看器打开图像并打印所有图像,这可能吗?可以在同一个队列中打开和打印所有图像还是必须一张一张打开?
更新 1:
我的问题在于 CFEXECUTE 中的参数。我已经打开cmd.exe
,然后在参数中我需要打开 Windows 照片查看器,它不是 exe,而是 DLL。这就是我的问题所在,然后我是否也会将所有图像的路径放在参数中?
更新 2:
这是我尝试过的代码:
<cfset args = []>
<cfloop index="thisitem" from="1" to="#arrayLen(session.orderbasket)#">
<cfset args[thisitem] = '#mainpath#\#session.orderbasket[thisitem].path#\#session.orderbasket[thisitem].image#'>
</cfloop>
<cfset printer = "DP-DS620">
<cfloop index="thisitem" from="1" to="#arrayLen(session.orderbasket)#">
<cfexecute name="C:\Windows\System32\cmd.exe" arguments="rundll32 C:\Program
Files\Windows Photo Viewer\PhotoViewer.dll '#args#' '#printer#'"
timeout="99"></cfexecute>
</cfloop>
我收到此错误:
复杂对象类型不能转换为简单值。
任何有关正确语法的帮助将不胜感激。