|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Follow-up: PDF generation running excrutiatingly slow
I'm running CF8 and trying to generate a PDF out of this page:Andy Matthews 12/13/07 11:33 P Try wrapping the content in a cfsavecontent (instead of cfdocument)James Holmes 12/13/07 11:39 P 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, when you say the code is identical, does that mean you are retrievingAntony Sideropoulos 12/14/07 04:00 A Andy,Rob Parkhill 12/14/07 09:25 A Just to follow up, you will maybe have to look into doing some page controlRob Parkhill 12/14/07 09:28 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 atRupesh Kumar 12/19/07 10:21 A 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. 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/ 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 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 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 ----- 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 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 ----- 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 ----- 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 ----- 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 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
|
March 11, 2010
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||