Re: CFDOCUMENT SRC="" and Dynamic HTML
I found a GPLv3 HTML->PDF converter with JS support: http://code.google.com/p/wkhtmltopdf/ Only done a few tests so far, but it looks interesting! ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325518 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: CFDOCUMENT SRC="" and Dynamic HTML
Because of formatting bugs with cfdocument, we've had to switch to software called WebGrabber - unlike all the other HTML->PDF generation software I've tried, WebGrabber works in an interesting way: it renders the HTML page and prints it to PDF - so you get what the browser/engine saw. (And with the engine used being WebKit, you get decent CSS support too.) I've just done a quick test with WebGrabber 2009, and it *will* execute JavaScript. (I did a simple For loop, and the resulting PDF contained the 0123456789 output). Unfortunately, it is fairly expensive and Windows-only, but you can try the evaluation version and see if it will work for you. http://www.activepdf.com/products/serverproducts/webgrabber/ ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325499 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CFDOCUMENT SRC="" and Dynamic HTML
Brook, I don't think that DHTML will render correctly for cfdocument no matter what you do. -Mark Mark A. Kruger, CFG, MCSE (402) 408-3733 ext 105 www.cfwebtools.com www.coldfusionmuse.com www.necfug.com -Original Message- From: Brook Davies [mailto:cft...@logiforms.com] Sent: Thursday, August 13, 2009 7:32 PM To: cf-talk Subject: CFDOCUMENT SRC="" and Dynamic HTML Is there any way to capture a rendered page that uses DHTML? I have a simple test case where I use some JS to do a document.write('test') to the page and then use CFDOCUMENT to grab the page via the src attribute. But none of the dynamic content is ever rendered. Has any one had any success with this? The only workaround I can think of, and its convoluted and I am not even sure it would work: 1. Create a Unique ID server side and write a database entry for the content to fetch 2. Call cfdocument or cfhttp to fetch the page, passing the uniqueID. 3. On the page, include an ajax call back to send back to the server the documents innerHTML (which should be the dynamic output) along with the uniqueID 4. The server (polls?) gets the new HTML from the database and uses it with CFDOCUMENT to create the page. This is a bit crazy right? There has got to be a better way. And oh yeah, The output is generated through a lot of JS, so I can't easily reproduce it on the server and avoid these steps. But, I wish there was some other way.. Brook ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325452 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: CFDOCUMENT SRC="" and Dynamic HTML
I think you're out of luck. If your pages require a client that parses and executes JavaScript in able to display all the content, cfhttp and cfdocument won't do that. I've never been able to find a way to easily execute JavaScript and collect the rendered HTML on the server. ~Brad Original Message Subject: CFDOCUMENT src="" and Dynamic HTML From: "Brook Davies" Date: Thu, August 13, 2009 7:32 pm To: cf-talk Is there any way to capture a rendered page that uses DHTML? I have a simple test case where I use some JS to do a document.write('test') to the page and then use CFDOCUMENT to grab the page via the src attribute. But none of the dynamic content is ever rendered. Has any one had any success with this? The only workaround I can think of, and its convoluted and I am not even sure it would work: 1. Create a Unique ID server side and write a database entry for the content to fetch 2. Call cfdocument or cfhttp to fetch the page, passing the uniqueID. 3. On the page, include an ajax call back to send back to the server the documents innerHTML (which should be the dynamic output) along with the uniqueID 4. The server (polls?) gets the new HTML from the database and uses it with CFDOCUMENT to create the page. ~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:325450 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4