0
votes

I am generating a pdf using cfdocument and it is working perfectly with this code:

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

If I include the #session.footer# variable inside it, it takes a lot of time to generate the 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>

The footer variable contains a complete footer section which I want to add at the end of the document. I am don't understand why it is this is taking so much longer. I am using ColdFusion 10.

2
I would point you to Ben Nadel's bennadel.com/blog/…. The comment section is where to look. A lot of people having slow cfdoc issues trace it to their images, sometimes absolute urls (http...) vs relative urls (/....) - Regular Jo
Without knowing what's in session.footer, it's rather hard to make sensible commentary on this, yes? - Adam Cameron
Definitely, more information to what is contained in that variable would be nice. To find that blog entry, I literally just googled cfdocument slow. - Regular Jo
does session.footer contain <img> tags? - Abram

2 Answers

1
votes

Have you tried creating the PDF using cfdocument, and then applying the footer using cfpdf as a second process? As with the above comments, it could be what is held in the session variable as well.

I would have left this as a comment instead of a solution, but StackOverflow wont let me :(

0
votes

Look in your Windows\system32\drivers\etc\hosts file. Someone had changed the IP from 127.0.0.1 to some local intranet IP and the names server from localhost to the DNS server name. I found that just changing the IP back to 127.0.0.1 was enough. Pdfs had gone from very quick to over 3 minutes. With the change, they were back to quick. (found this per a comment in https://forums.adobe.com/thread/1121909)