[LRUG] PDF generation from HTML with complex JS

Derek Ekins derek at spathi.com
Wed Nov 2 09:16:36 PDT 2011


I've not done this but I guess the key thing here is you need to execute
the JS to get the final html.
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.

Like I said - haven't tried but it may do the trick!

On 2 November 2011 16:08, Stephen Bartholomew <steve at curve21.com> wrote:

> Hey all,
>
> On the subject of PDF generation, has anyone had success converting
> JS-heavy pages to PDF?
>
> The page in question is an Open Layers based map with vector layers.
>  There's an example of the map here:
> http://communities4renewables.co.uk/open/maps/5cdbb6b2-33ed-4e7f-ad59-a24327006711
>
> 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.
>
> Any help/experience would appreciated!
>
> Cheers,
>
> Steve
>
> --
> Stephen Bartholomew
>
> Curve21
>
> www.curve21.com
> 07729 60 60 79
> steve at curve21.com
>
>
> _______________________________________________
> Chat mailing list
> Chat at lists.lrug.org
> http://lists.lrug.org/listinfo.cgi/chat-lrug.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20111102/0a1f3910/attachment-0003.html>


More information about the Chat mailing list