filestack/FilestackClient.php
public function screenshot($url, $store_options = [],
        $agent = 'desktop', $mode = 'all', $width = 1024, $height = 768, $delay = 0)
    {
        $process_attrs = [
            'a' => $agent,
            'm' => $mode,
            'w' => $width,
            'h' => $height,
            'd' => $delay
        ];

        $transform_tasks = [
            'urlscreenshot' => $process_attrs
        ];

        if (!empty($store_options)) {
            $transform_tasks['store'] = $store_options;
        }

        // call TransformationMixin function
        $result = $this->sendTransform($url, $transform_tasks, $this->security);

        return $result;
    }
public function screenshot($url, $store_options = [],
        $agent = 'desktop', $mode = 'all', $width = 1024, $height = 768, $delay = 0)
    {
        $process_attrs = [
            'a' => $agent,
            'm' => $mode,
            'w' => $width,
            'h' => $height,
            'd' => $delay
        ];

        $transform_tasks = [
            'urlscreenshot' => $process_attrs
        ];

        if (!empty($store_options)) {
            $transform_tasks['store'] = $store_options;
        }

        // call TransformationMixin function
        $result = $this->sendTransform($url, $transform_tasks, $this->security);

        return $result;
    }
public function screenshot ( $ url , $ store_options = [ ] , $ agent = 'desktop' , $ mode = 'all' , $ width = 1024 , $ height = 768 , $ delay = 0 ) { $ process_attrs = [ 'a' => $ agent , 'm' => $ mode , 'w' => $ width , 'h' => $ height , 'd' => $ delay ] ; $ transform_tasks = [ 'urlscreenshot' => $ process_attrs ] ; if ( ! empty ( $ store_options ) ) { $ transform_tasks [ 'store' ] = $ store_options ; } // call TransformationMixin function $ result = $ this -> sendTransform ( $ url , $ transform_tasks , $ this -> security ) ; return $ result ; }
Take a screenshot of a URL

@param string    $url            URL to screenshot
@param string    $store_options  optional store values
@param string    $agent          desktop or mobile
@param string    $mode           all or window
@param int       $width          Designate the width of the browser window. The
width is 1024 by default, but can be set to
anywhere between 1 to 1920.
@param int       $height         Designate the height of the browser window.
The height is 768 by default, but can be set
to anywhere between 1 to 1080.
@param int       $delay          Tell URL Screenshot to wait x milliseconds before
capturing the webpage. Sometimes pages take
longer to load, so you may need to delay the
capture in order to make sure the page is
rendered before the screenshot is taken. The
delay must be an integer between 0 and 10000.

@throws FilestackException   if API call fails, e.g 404 file not found

@return Filestack/Filelink
Take a screenshot of a URL