I've not done this but I guess the key thing here is you need to execute the JS to get the final html.<div>To do that you could use one of the headless browsers out there like htmlunit to load the page and then save the html it produces and pass that to your pdf generator.</div>
<div><br></div><div>Like I said - haven't tried but it may do the trick!<br><br><div class="gmail_quote">On 2 November 2011 16:08, Stephen Bartholomew <span dir="ltr"><<a href="mailto:steve@curve21.com">steve@curve21.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div>Hey all,</div><div><br></div><div>On the subject of PDF generation, has anyone had success converting JS-heavy pages to PDF?</div>
<div><br></div><div>The page in question is an Open Layers based map with vector layers. There's an example of the map here: <a href="http://communities4renewables.co.uk/open/maps/5cdbb6b2-33ed-4e7f-ad59-a24327006711" target="_blank">http://communities4renewables.co.uk/open/maps/5cdbb6b2-33ed-4e7f-ad59-a24327006711</a></div>
<div><br></div><div>I've tried using wkhtmltopdf which somewhat works but renders different layers inconsistantly depending on the configuration. I've tried timeouts and all the advice I can find online. I know there are paid solutions like prince etc but I'm reluctant to invest in that without an idea of the success.</div>
<div><br></div><div>Any help/experience would appreciated!</div><div><br></div><div>Cheers,</div><div><br></div><div>Steve</div><div><div><br></div><font color="#888888">-- <br>Stephen Bartholomew<br><br>Curve21<br><br><a href="http://www.curve21.com" target="_blank">www.curve21.com</a><br>
<a href="tel:07729%2060%2060%2079" value="+447729606079" target="_blank">07729 60 60 79</a><br><a href="mailto:steve@curve21.com" target="_blank">steve@curve21.com</a><br><br>
</font></div>
<br>_______________________________________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
<a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" target="_blank">http://lists.lrug.org/listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br></div>