A PHP Error was encountered

Severity: Warning

Message: mysqli::__construct(): (HY000/1045): Access denied for user 'root'@'localhost' (using password: NO)

Filename: classes/RootController.php

Line Number: 99

Item Documentation | Otakita

How To ? Item Documentation

PHP Web ScreenShot v1.0

PHP Web ScreenShot is a fast way to capture all website content and save it into an image. It's only need about 10 seconds for one screenshots (depending on website).

The feature is not only to save into image, you can make a few custom edit such as Resize, Crop and set watermark like text or image.

Created: 03/01/2017. Latest Update: 03/01/2017

Crafted with love by Otakita

  • Screenshot your favorite website.
  • Resize it into thumbnail or according to the needs.
  • Crop it with custom size (width x height) and margin (top and left).
  • Give watermark like text or image.

Setup your PC or Server

  • You need to activate PHP extension Image GD.
    Edit from php.ini file.
    Change to

  • You also need to install phantomjs. You can open http://phantomjs.org/download.html to see how to install it.

    If you have some trouble to this installation, please contact us in contact@otakita.com

Setup Your Files

First, after you buy it from envato, you can download the zip file.
  • You can extract the zip file in folder www or htdocs(your localhost).
  • There will be two folders, folder DB, DOCUMENTATION, screenshot_engine and public_html.
    Folder DB contains sql that you have to import (first, create your database), while folder public_html contains all file application.
  • That's it. Your file has been ready.

Confirguration Database

  • Open file RootController.php in folder public_html/classes/.
  • You can change the settings according to your mysql settings.

  • You can now run the program from your localhost.

Confirguration Directory Permission

  • Under linux, please make sure you have grant access to write into directory (chmod 775) public_html/asset/screenshot_engine and public_html/asset/screenshot_engine/thumbs.

The basic framework for this program is use CodeIgniter that we have a lot of modification. But we hope you can easily understanding.
We will give short explanation below :

  • RootController.php in public_html/classes/ contains the initial settings that will be used by all controllers.
  • Controllers and Views are exactly same like CodeIgniter framework.

  • We doesn't use models. As a replacement, there are folder classes/Domain/ and classes/DataSource/.
  • Domain is representation of fields of table. For example RoomDomain.php is representation of fields room table.
  • DataSource is to do the query to access the database.

  • The other important to know is classes/Presentation/.
    You can add asset CSS or Javascript with HtmlHeaderFooter.php.
    To do render side menu, you can use file MenuBarRenderer.php.

How it Works ?

The engine code to screenshot is screenshot.js in directory web_screenshot/screenshot_engine/screenshot.js.
You can call page.render("image_name.png"); to screenshot the page content.

If you want to screenshot only some area, you can set option in
page.clipRect = {top: topPixel, left: leftPixel, width: sizeWidth, height: sizeHeight};
and call it before you call
Menu Screenshot Sample 4 will show you how to implement it.

We already give some notes in screenshot.js file which parts could be changed.

The other class that you need to know is Image.php in directory web_screenshot/public_html/classes/Utilities/Image.php.
There are have two function, resizeImage() and watermark()

  • resizeImage()
    Used to resize image. It can resize with proportional or with crop the image.
  • watermark()
    Used to give watermark. You can set $type with value 'text' or 'stamp'.

Still Need Help ?
Do not panic! Feel free to get in touch with us. You can leave comment on the item page or send email to contact@otakita.com. Thank you.