【发布时间】:2016-12-14 15:28:28
【问题描述】:
我正在使用<cfhtmltopdf> 标签将 .cfm 文件作为模板拉入并创建 PDF。当我使用 jpg 作为图像格式时,一切正常。但如果图像是 BMP - 出于某种原因,它将无法工作。
在模板文件中,我使用没有过滤器的<cfdirectory> 标记来拉入图像。
<cfdirectory directory="E:\xxx\images\#image_ID#\" name="myDir" type="file" sort="datelastmodified">
然后我使用<cfloop> 来显示目录中的图像...
<cfloop query="myDir">
<cfif right(myDirMain.name,4) is ".bmp" >
<img src="#request.root#images/#images_ID#/#myDir.name#" border="0" width="230px" style="margin-bottom:15px;" />
</cfif>
这对 jpg 很有用,但在尝试使用 bmp 图像时 - 就不好了。
有谁知道 bmp 图像是否存在问题或仅适用于 jpg 图像的原因?
【问题讨论】:
-
您所说的“但是在尝试使用 bmp 图像时 - 不好”是什么意思?代码是否跳过了
<img>标签?图像在浏览器中看起来不是“好”吗?是否抛出错误? -
您好,我在应该有图像的地方创建的 PDF 中缺少一个图像图标。谢谢
-
您能附上您的
<cfhtmltopdf ...代码吗? -
当然,给你...
<cfset temppath="#uploadPath#pdf"> <cfhtmltopdf pagetype="a4" destination="#temppath#/#id_refid#.pdf" overwrite="Yes" orientation = "portrait"> <cfinclude template="../includes/pdf_a4_template.cfm"> </cfhtmltopdf> -
您是否提交了错误报告(或找到现有的)?如果是这样,请继续将其添加到您的答案中,以便更明显,其他人可以对其进行投票。
标签: coldfusion bmp coldfusion-11