generating a screenshot of a website using jquery

If you look at wkhtmltox, there’s native lib/app for converting a webpage to an image.

<?php // file: img.php
    $img=render_image($_GET['url']);
?>


<!-- Your Website -->

<img alt="ldr"/>

<script type="text/javascript">
    $(document).ready(function(){
        var url="http://google.com/";
        $('#img').attr('src','img.php?url="+encodeURIComponent(url));
    });
</script>

In case the comment wasn”t clear enough, you need PHP somewhere which could run a native program.

Leave a Comment