|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
Follow-up: PDF generation running excrutiatingly slow
Author: Rupesh Kumar
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#295097
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
Author: Andy Matthews
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294781
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 -----
Author: Mark Kruger
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294779
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 -----
Author: Andy Matthews
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294777
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
Author: Rob Parkhill
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294774
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 -----
Author: Rob Parkhill
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294773
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
Author: Antony Sideropoulos
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294759
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 -----
Author: Andy Matthews
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294750
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
Author: Andy Matthews
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294751
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
Author: James Holmes
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294748
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/
Author: Andy Matthews
Short Link: http://www.houseoffusion.com/groups/cf-talk/thread.cfm/threadid:54540#294747
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.
|
May 24, 2012
|
Latest Fusion Authority Articles
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||