0

我正在生成一个pdf cfdocument,它与这段代码完美配合:

<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。

4

2 回答 2

1

您是否尝试过使用 cfdocument 创建 PDF,然后使用 cfpdf 作为第二个过程应用页脚?与上述评论一样,它也可能是 session 变量中保存的内容。

我会将此作为评论而不是解决方案,但 StackOverflow 不会让我 :(

于 2015-07-02T17:21:15.017 回答
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中的评论找到此内容)

于 2017-01-10T22:43:58.520 回答