I need to take screenshots of few web pages and save them in a folder using php.
I want to do this using a php script, is there a way I can render those webpages and take screenshot of a particular area after the website is fully loadedd? - I'm using windows.
I tried using wkhtmltoimage but it takes low quality screenshots and also it takes the screenshot before the whole page is loaded, so some images of the webpage are not appearing in the screenshot, is there a way to do this using php?
Please help php specialists. Thank you
Click the three-dot icon from the top-right corner and select Run command. Also, you can press Ctrl+Shift+P on Windows or Command+Shift+P on Mac. Type screenshot into the search box. Select Capture full-size screenshot.
Android. The universally acknowledged screenshot shortcut that usually works across Android versions, manufacturers, and handsets is Power+Volume Down.
Open the webpage you want to capture, then press and hold “Ctrl” + “Alt.” Then, press the “Prtsc” key. Left-click on the corner of the red highlighted box and drag to select the screenshot area.
PHP runs on server side, so to be able to take screenshots you need something to render HTML (a browser-like script) and generate a image of it. This script will do that (wkhtmltoimage too):
HTML2PS: http://freecode.com/projects/html2ps_php
But I still think the best solution will be using javascript. Of course, only the client will have access to the screenshots, and maybe you can upload the image to the server. A client browser is better than any kind of server script.
If that is the case, I would suggest using HTML2CANVAS:
HTML2CANVAS: http://html2canvas.hertzen.com/
The best server solution will be a linux distribution with a google chrome installation and a local script to take screenshots. That is the only way to get accurate screenshots of a web page that may contain javacript/HTML5/animations and other difficult to render stuff.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With