2015-02-09 53 views
0

我使用cfdocument生成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

+0

我会告诉你Ben Nadel的http://www.bennadel.com/blog/1949-the-content-of-this-document-process-通吃更比60000-毫秒到-p rocess.htm。评论部分是要看的地方。很多有缓慢cfdoc问题的人跟踪它们的图像,有时是绝对URL('http ...')vs相对URL('/ ....') – 2015-02-09 22:00:40

+4

* * * session.footer中不知道什么*很难对此做出合理的评论,是的? – 2015-02-10 06:56:32

+0

当然,更多的信息包含在该变量将是很好的。为了找到这个博客条目,我简直就是''cfdocument slow''。 – 2015-02-10 16:21:31

回答

0

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

我早就离开这个作为一个评论,而不是一个解决方案,但StackOverflow上不会让我:(

0

看着你的Windows \ SYSTEM32 \ DRIVERS \ ETC \ hosts文件,有人已经从127.0改变了IP。 0.1到一些本地内部网IP和从localhost到DNS服务器名称的服务器名称,我发现只需将IP更改回127.0.0.1就足够了,Pdfs已经很快到了3分钟以上,随着更改,它们是 (在https://forums.adobe.com/thread/1121909的评论中发现这个)