cfdocument与性能问题

时间:2015-02-09 20:53:41

标签: coldfusion cfdocument cfpdf

我使用cfdocument生成pdf,它与此代码完美配合:

<cfdocument format="PDF" fontembed="true" saveAsName="file1" mimetype="application/pdf" localUrl="true">
    <cfoutput>
        #response.filecontent# 
        <cfdocumentitem type="footer"> 
           #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#
        </cfdocumentitem>
    </cfoutput>
</cfdocument>

如果我在其中包含#session.footer#变量,则需要花费大量时间来生成PDF。

<cfdocument format="PDF" fontembed="true" saveAsName="file1" mimetype="application/pdf" localUrl="true">
    <cfoutput>
        #response.filecontent# 
        #session.footer#
        <cfdocumentitem type="footer"> 
           #cfdocument.currentpagenumber# of #cfdocument.totalpagecount#
        </cfdocumentitem>
    </cfoutput>
</cfdocument>

页脚变量包含一个完整的页脚部分,我想在文档的末尾添加它。我不明白为什么这花了这么长时间。我正在使用ColdFusion 10。

2 个答案:

答案 0 :(得分:0)

您是否尝试使用cfdocument创建PDF,然后使用cfpdf作为第二个进程应用页脚?与上述注释一样,它也可以是会话变量中的内容。

我会把它留作评论而不是解决方案,但StackOverflow不会让我:(

答案 1 :(得分:0)

查看Windows \ system32 \ drivers \ etc \ hosts文件。有人将IP从127.0.0.1更改为某些本地Intranet IP,名称服务器从localhost更改为DNS服务器名称。我发现只需将IP更改回127.0.0.1即可。 Pdfs已经从很快到超过3分钟。随着变化,他们又恢复了快速。 (根据https://forums.adobe.com/thread/1121909

中的评论找到了这个
相关问题