The Content Of This Document Process Takes More Than 60000 Milliseconds To Process

Posted June 23, 2010 at 7:08 PM by Ben Nadel

Tags: ColdFusion

I was recently using CFDocument to create a rather large PDF with tons of embedded images when I got the following ColdFusion error:

The content of this document process takes more than 60000 milliseconds to process. This timeout value is obtained from the request timeout set in the ColdFusion Administrator.

At the time, I was already overriding the request timeout with a CFSetting tag (I had anticipated this page taking a while to run); this override, however, did not seem to affect the CFDocument tag's performance. I then went into the ColdFusion administrator, as the error suggested, and increased the core request timeout settings. This also did not appear to help the matter. It seems that there is an upper limit to the amount of time that the CFDocument tag will be allowed to run before it is forced to timeout. I did a whole bunch of Googling on this and asked around and could not find anyway to overcome this limitation.

I am posting this here not with answers, but with the hope that someone might drop by with a comment and tell me how to fix this. I have since changed my strategy to using smaller images. But, if I should ever need to create a very large PDF, I would love to know how to overcome this hurdle.

It should be noted that I am running on ColdFusion Standard, so there might be some programmatic throttling that is not present in the Enterprise edition of the ColdFusion application server.


You Might Also Be Interested In:



Reader Comments

Jun 23, 2010 at 7:21 PM // reply »
46 Comments

Do your embedded images have an Adobe RGB Color space? I've run into slowdowns in the past where the color palette was non-standard.
http://en.wikipedia.org/wiki/Adobe_RGB_color_space

One of the methods I've used to avoid timing out on large document generation is to create multiple smaller files and then merge them together. Prior to CF8 I was using the PDFTK toolkit to merge them all together:
http://www.accesspdf.com/pdftk/


Jun 23, 2010 at 7:26 PM // reply »
11,241 Comments

@James,

We were thinking of using the multiple smaller documents with merging approach; but it was just for an internal project (ie. not billable), so we just opted for the quicker, smaller images. In the end, it actually turned out to probably be the better solution for what we were going for. BUT, it was frustrating not being to overcome the problem ... grrrr, HULK SMASH!

I'm not aware of the color space issue. I can say that the images were all JPG files exported from Adobe Fireworks, so hopefully they were compatible with other Adobe products.


Jun 23, 2010 at 7:33 PM // reply »
13 Comments

I was going to suggest what you ended up doing.

You might be having image retrieval issues as well. Try using the file:// protocol for images vs http. That has helped me in the past.


Jun 23, 2010 at 7:41 PM // reply »
11,241 Comments

@Mike,

I tried using file:///. I also tried using localURLs and relative pathing. It's just a general processing timeout I think. The "proofs of concept" worked fine with 30-40 images. But, once we beefed it up to several hundred images, it was just more than could be done in the given time.


Jun 23, 2010 at 10:50 PM // reply »
113 Comments

If the images are spread across multiple pages, you can render the pages separately in separate documents and then afterward stitch all the documents together.

Additionally, you can drop down from cfdocument into iText, the open source pdf-rendering engine that cfdocument uses under the hood.


Jun 23, 2010 at 10:51 PM // reply »
14 Comments

@Ben, I had a similar issue when I was trying to generate a very large PDF using cfdocument. The reason I found was the virtual memory size in that cannot be increased beyond 1.6 GB.

Note: This issue was in CF 7.

Workaround: Wrote a windows service to do the task.


Jun 23, 2010 at 11:38 PM // reply »
9 Comments

Could you defer the processing by sending it to an asynchronous gateway?


Jun 24, 2010 at 10:40 PM // reply »
14 Comments

@Jon,

Sending it to the worker process in a asynchronous gateway would also not do the trick I presume because of the file size. Please correct me if I am wrong.


Jun 25, 2010 at 2:15 PM // reply »
11,241 Comments

For version "2" of this internal tool, we might get a bit more clever. But for now, we're just sticking with the smaller images as a proof of concept.


Sep 28, 2010 at 8:49 AM // reply »
1 Comments

We had this very problem today and seemed to resolve itself with two small changes:

1.) All images must have relative pathing instead of absolute calls to "http://wherever..."; and

2.) Set the CFDOCUMENT attribute 'localurl="yes"'

Apparently, CFDOC will hang on absolute calls, so you may also need to check your CSS if used.

Hope this helps, and thank you so much for all you do.

~T


Oct 3, 2010 at 10:19 PM // reply »
11,241 Comments

@Tim,

Yeah, the localUrl attribute definitely helps sometimes. We ran into a huge headache involved route-back issues a while back (arg that was a PAIN to debug). Our problem was simply the large number of images we wanted to include in the document. As we took some images out, it eventually started working (I'm talking like 30MB+ worth of images in the PDF).


Dec 6, 2010 at 9:03 AM // reply »
1 Comments

Same here. No images. Just this:

<cfdocument format="PDF" localUrl="yes">
OK
</cfdocument>

And the same timeout error message.


Feb 22, 2011 at 3:49 PM // reply »
1 Comments

We just had that problem and once we restarted coldfusion on the server the cfdocument problem stopped. I'm not sure if some cf memory filled up. Strange problem because my other cf pages were fine, it was just the ones with cfdocument wrapper.


Mar 31, 2011 at 9:21 AM // reply »
1 Comments

I just had this same issue on a CF 7 environment. I was generating PDF reports that had several references to external resources: .css, .gif, .jpg. I replaced all relative paths to fullfy-qualified paths using the ExpandPath() method and all issues were resolved.
<div>
Example:
</div>
<div>
&lt;cfset fullSiteRoot = ExpandPath("/")&gt;
</div>
<div>
&lt;cfoutput&gt;
&lt;link src="#fullSiteRoot#css/global.css" rel="stylesheet" type="text/css" media="all"/&gt;
&lt;/cfoutput&gt;
</div>


Jun 23, 2011 at 3:04 PM // reply »
4 Comments

I just created a forum post about this problem, we cut the load times from 60+ seconds to 1 second with the described fixes.

http://forum.hostek.com/showthread.php?493-cfdocument-timeout-fixing-timeout-problems-with-cfdocument

Hope this helps somebody.

Jon C.


Jun 28, 2011 at 11:01 PM // reply »
11,241 Comments

@Victor, @Jon,

Awesome suggestion to use expandPath() for linked files. I haven't tested this, but that sounds like it would make a lot of sense.


Mar 14, 2012 at 4:08 AM // reply »
1 Comments

Hello,

Did you find any reason for this issue? Since two day, any of my CFDOCUMENT "PDF" return the error "content....more than 20000 milliseconds..." on one of my server... My other server (PRODUCTION) is not having that issue, I checked the configuration and their are identical.


Aug 21, 2012 at 8:53 AM // reply »
3 Comments

I'm desperately looking for a solution, too. My error message is really absurd.

"The content of this document process takes more than 0 milliseconds to process."

0 milliseconds? I use CF9.0.1 and I don't know where I can change "0 milliseconds" setting...


Dec 4, 2012 at 9:11 AM // reply »
1 Comments

@Tim,

Removing the "http://..." and replacing with relative paths + adding 'localUrl="yes"' to the cfdoc-tag was the magic fix in my case.

Thanks for that!



Post A Comment

Comment Etiquette: Please do not post spam. Please keep the comments on-topic. Please do not post unrelated questions or large chunks of code. And, above all, please be nice to each other - we're trying to have a good conversation here.

Please review the following issues:

Author Name:


Author Email:

Author Website:

Comment:

Supported HTML tags for formatting: <strong>bold</strong>   <em>italic</em>   <code>code</code>







  • Help Wanted - Find Your Next ColdFusion Job
Ben Nadel's Company - Epicenter Consulting Recent Blog Comments
May 22, 2013 at 7:52 AM
Nested Views, Routing, And Deep Linking With AngularJS
Hi, Just a quick thank you. As it happens, for my own purposes, the pending ui-router work being done in native angular is likely the one I'll adopt, but your exploration, code and documentation of ... read »
May 22, 2013 at 4:43 AM
How Do You Use The ColdFusion CFParam Tag?
'<cfparam>' or 'isDefined()and <cfset>' performs the same task.Is there any difference? ... read »
May 21, 2013 at 7:46 PM
Using Plupload For Drag & Drop File Uploads In ColdFusion
No luck. At least I have uncovered the cause, URLScan 3.1. Here is what I see in the IIS log when a file is over 30mb. 2013-05-21 23:29:05 10.105.45.128 GET /plupload/assets/jquery/jquery-1.8. ... read »
May 21, 2013 at 6:12 PM
Using Plupload For Drag & Drop File Uploads In ColdFusion
Ben, I did not see you after Pete Freitag's Lockdown session at cfObjective but he said that IIS sets file size limits at 30MB by default which just happened to be the threshold for file size when ... read »
May 21, 2013 at 11:51 AM
Ask Ben: Parsing Very Large XML Documents In ColdFusion
Looking at my first ever XML document that I have to parse and put into MS SQL 2000 with CF8. I get it to list the desired Field name, many times over, and have a long list of this field name displa ... read »
May 21, 2013 at 9:25 AM
Turning Off and On Identity Column in SQL Server
you are awesome..i am lucky to get this blog between such a garbage one....Thanks, Prashant ... read »
May 20, 2013 at 4:38 PM
Using A Dynamic Column Name With ValueList() In ColdFusion
@Dana, Your confusion is well founded, since this is a very confusing features. In fact, it ONLY works if you use array notation. Meaning, that this: arrayToList( query[ "columnName" ] ) ... read »
May 20, 2013 at 4:34 PM
Using A Dynamic Column Name With ValueList() In ColdFusion
I was thinking chicken and the egg, I wouldn't have expected it to work in the valuelist going in I guess. Maybe I just need a beer, long day :) ... read »
InVision App - Prototyping Made Beautiful With Prototyping Tools