House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

Follow-up: PDF generation running excrutiatingly slow

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Here's some updates used for testing:
Andy Matthews
12/14/07 12:11 A
Here's some updates used for testing:
Andy Matthews
12/14/07 12:11 A
Andy,
Rob Parkhill
12/14/07 09:25 A
Rob,
Mark Kruger
12/14/07 09:53 A
Mark...
Andy Matthews
12/14/07 10:04 A
Rob...
Andy Matthews
12/14/07 09:49 A
I posted a blog entry about this at
Rupesh Kumar
12/19/07 10:21 A
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
12/13/2007 11:33 PM

I'm running CF8 and trying to generate a PDF out of this page: http://gaylordoprylandsales.com/prop/proposal.cfm?view=73534E3B54060A4C061052691D13 The page loads in fairly quickly, but creating a PDF from the same exact code takes several minutes or more, and in some cases times out: http://gaylordoprylandsales.com/prop/proposal_pdf.cfm?view=73534E3B54060A4C061052691D13 The code is identical in every aspect with the exception of the cfdocument tag wrapped around the code from the first link. I need to get some information on this as quickly as possible. Is my HTML code causing the issue? Is it my CF code? I need to put this app to bed as soon as I can, but this is the last remaining piece. I started running the PDF generation as soon as I started typing this post and it's only just now finally loaded. That's about 2 or 3 minutes worth of time. I could understand if I was generating 30 or 40 pages worth of content, but this is 6 pages. Adobe, please help.

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
James Holmes
12/13/2007 11:39 PM

Try wrapping the content in a cfsavecontent (instead of cfdocument) and then cfoutputting that result between the cfdocument tags; let us know if that speeds anything up. On Dec 14, 2007 1:21 PM, Andy Matthews <andymatthews@comcast.net> wrote: ----- Excess quoted text cut - see Original Post for more ----- -- mxAjax / CFAjax docs and other useful articles: http://www.bifrost.com.au/blog/

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
12/14/2007 12:11 AM

Here's some updates used for testing: This page is the exact same source code as the original link, but has NO CF processing (other than the cfdocument tag): http://gaylordoprylandsales.com/prop/PDFtest_01.cfm This page has had it's complex div based layout converted to tables: http://gaylordoprylandsales.com/prop/PDFtest_02.cfm This page is a duplicate of link 01 above, with the content split out into a cfsavecontent tag: http://gaylordoprylandsales.com/prop/PDFtest_03.cfm This page is a duplicate of link 02 above, with the content split out into a cfsavecontent tag: http://gaylordoprylandsales.com/prop/PDFtest_04.cfm

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
12/14/2007 12:11 AM

Here's some updates used for testing: This page is the exact same source code as the original link, but has NO CF processing (other than the cfdocument tag): http://gaylordoprylandsales.com/prop/PDFtest_01.cfm This page has had it's complex div based layout converted to tables: http://gaylordoprylandsales.com/prop/PDFtest_02.cfm This page is a duplicate of link 01 above, with the content split out into a cfsavecontent tag: http://gaylordoprylandsales.com/prop/PDFtest_03.cfm This page is a duplicate of link 02 above, with the content split out into a cfsavecontent tag: http://gaylordoprylandsales.com/prop/PDFtest_04.cfm

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Antony Sideropoulos
12/14/2007 04:00 AM

Andy, when you say the code is identical, does that mean you are retrieving images and css via http? try using the file protocol instead, and grab the resources straight off the file systen. take dns, http, etc, out of the equation. On Dec 14, 2007 3:21 PM, Andy Matthews <andymatthews@comcast.net> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rob Parkhill
12/14/2007 09:25 AM

Andy, The file size is huge.  2.8 MB when it finally finishes.   I took your code, and did it locally, now I don't have all of the pictures in mine, and there were a couple of open tags (an H1 at the beginning and a div somewhere), but it generated in 2823 ms and the PDF is only 560 kb.  With the images, it is killing everything.  I will get the time, but the inclusion of the images is the problem. so 142438 ms and 2.8 mb with Images... What are the file sizes of the images?  Maybe with reduction in image size would help? Rob

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rob Parkhill
12/14/2007 09:28 AM

Just to follow up, you will maybe have to look into doing some page control with the cfdocument tags.  I have a PDF with parts of images spanning pages, and it just looks terrible.  Are the proposals always going to contain similar information?  Just wondering if you could then add some pagination to the document (certain items/sections on certain pages?) my two cents. Rob On Dec 14, 2007 9:22 AM, Rob Parkhill <robert.parkhill@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Mark Kruger
12/14/2007 09:53 AM

Rob, I have a couple of tips on my blog about PDFs and optimization. Recall that CF is doing HTTP "get" type requests for the resources it needs - so when you include images it has to create HTTP request to retrieve each of them. One work around is to use the  file://  type syntax to map to the images on the hard drive. This allows the PDF generater to pull them off of the disk rather than generating an HTTP request. Your images themselves need to be optimized and "pre-sized". We have found PNG files work a bit better than other image types.  These posts might be helpful: http://mkruger.cfwebtools.com/index.cfm/2006/2/16/cfdocument.performance http://www.coldfusionmuse.com/index.cfm/2006/5/29/cfdocument.ssl (look in the comments for that "file" syntax... It requires escaping some slashes I believe.. ) . Good luck. -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Just to follow up, you will maybe have to look into doing some page control with the cfdocument tags.  I have a PDF with parts of images spanning pages, and it just looks terrible.  Are the proposals always going to contain similar information?  Just wondering if you could then add some pagination to the document (certain items/sections on certain pages?) my two cents. Rob On Dec 14, 2007 9:22 AM, Rob Parkhill <robert.parkhill@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
12/14/2007 10:04 AM

Mark... Thanks for those comments...I'll give those a try! Rob, I have a couple of tips on my blog about PDFs and optimization. Recall that CF is doing HTTP "get" type requests for the resources it needs - so when you include images it has to create HTTP request to retrieve each of them. One work around is to use the  file://  type syntax to map to the images on the hard drive. This allows the PDF generater to pull them off of the disk rather than generating an HTTP request. Your images themselves need to be optimized and "pre-sized". We have found PNG files work a bit better than other image types.  These posts might be helpful: http://mkruger.cfwebtools.com/index.cfm/2006/2/16/cfdocument.performance http://www.coldfusionmuse.com/index.cfm/2006/5/29/cfdocument.ssl (look in the comments for that "file" syntax... It requires escaping some slashes I believe.. ) . Good luck. -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com Just to follow up, you will maybe have to look into doing some page control with the cfdocument tags.  I have a PDF with parts of images spanning pages, and it just looks terrible.  Are the proposals always going to contain similar information?  Just wondering if you could then add some pagination to the document (certain items/sections on certain pages?) my two cents. Rob On Dec 14, 2007 9:22 AM, Rob Parkhill <robert.parkhill@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Andy Matthews
12/14/2007 09:49 AM

Rob... Images are controlled by the user. They FTP them to the server, then add them to the database so that they can be selected in the admin app. There are 3 widths of images, 200, 300, and 600 by however tall they end up being. The proposal is broken down into distinct modules (<div class="modCont">) and there could be any number of modules in a single proposal. I don't care so much about the file size, but the generation time is an absolute deal break. I didn't notice that about the open tags...I'll have to look into that. I thought I had coded the HTML well. Yes, I know about the page breaks...it looks horrible like that, but I'm not sure how to fix it. The proposals will always be fairly similar in appearance, if not in content. There will always be images, there will always be a fair amount of text, etc. However the modules and their contents will be in whatever order the user specifies. So I can't rely on "this" module being on a specific page, etc. Thanks for your input man, I appreciate it. Andy, The file size is huge.  2.8 MB when it finally finishes.   I took your code, and did it locally, now I don't have all of the pictures in mine, and there were a couple of open tags (an H1 at the beginning and a div somewhere), but it generated in 2823 ms and the PDF is only 560 kb.  With the images, it is killing everything.  I will get the time, but the inclusion of the images is the problem. so 142438 ms and 2.8 mb with Images... What are the file sizes of the images?  Maybe with reduction in image size would help? Rob

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Rupesh Kumar
12/19/2007 10:21 AM

I posted a blog entry about this at http://coldfused.blogspot.com/2007/12/images-and-cfdocument-performance.html Let me know if that helps. Thanks & Regards, Rupesh Adobe ColdFusion Team


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

March 11, 2010

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
   1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31