图像未在cfdocument pdf中显示Coldfusion 10 [英] Image is not displaying in cfdocument pdf for coldfusion 10

查看:118
本文介绍了图像未在cfdocument pdf中显示Coldfusion 10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ColdFusion 10企业版,并且在使用CFDOCUMENT生成PDF时无法显示图像.以下是我正在使用的代码:

I am using ColdFusion 10 Enterprise edition, and am unable to display images when using CFDOCUMENT to generate a PDF. Below is the piece of code I am using:

<cfsavecontent variable="report">
   <table align='center'>
    <cfoutput query="VARIABLES.result">
            <tr>
              <td>
                 <div class='addInfoDetails'>#SHOWINFO#</div>
              </td>
            </tr>
       </cfoutput>  
   </table>
</cfsavecontent>

在上面的代码中,VARIABLES.result查询来自数据库,而SHOWINFO是具有图像和文本内容的变量.例如:

In the above code, the VARIABLES.result query is coming from database and SHOWINFO is a variable having the content of image and text. For example:

 SHOWINFO  = 
 "<p> Hi This is the test information
     <img alt="image" src="../TestBank/test/info/5KQ.jpg"/>
 </p>"

如果将SHOWINFO变量转储到CFSAVECONTENT内部,则图像会正确显示.但是,当我使用CFDOCUMENT将其转换为PDF时,图像无法显示.

Here if dump the SHOWINFO variable inside the CFSAVECONTENT, the image displays correctly. But when I convert this into PDF, using CFDOCUMENT, the image is not displaying.

下面是我用来生成pdf的代码块:

Below is the code block I am using to generate the pdf:

<cfdocument format="PDF" saveasname="TestPDF">
  <cfoutput>#report#</cfoutput>
</cfdocument>

谢谢.

推荐答案

我通过在CFDOCUMENT标记中添加属性"localUrl = yes"对其进行了修复.

I fixed it by adding the attribute "localUrl = yes" in CFDOCUMENT tag.

现在对我来说很好.

这篇关于图像未在cfdocument pdf中显示Coldfusion 10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆