1
- Cagoi screenshots
1
+ Cagoi screenshots v1.0
2
2
=================
3
3
4
4
Library for an easy screenshots making
@@ -55,6 +55,7 @@ $params = new Cagoi\Screenshots\Params\MakeParams('https://google.com');
55
55
$params->setCallback("http://my.site.com/callback");
56
56
$creator = Cagoi\Screenshots\ImageCreator();
57
57
$creator->add('full', '<path to save >', '<filename >');
58
+ // Send the task
58
59
$client->makeScreenshot($params, $adapter, $creator);
59
60
```
60
61
@@ -67,8 +68,10 @@ $params = new Cagoi\Screenshots\Params\MakeParams('https://google.com');
67
68
$params->setCallback("http://my.site.com/callback");
68
69
// Element id setter
69
70
$params->setElementId("<element id >");
71
+ // Saver for ready files
70
72
$creator = Cagoi\Screenshots\ImageCreator();
71
73
$creator->add('full', '<path to save >', '<filename >');
74
+ // Send the task
72
75
$client->makeScreenshot($params, $adapter, $creator);
73
76
```
74
77
@@ -90,6 +93,8 @@ $params->addWidthScale(300);
90
93
$params->addHeightScale(300);
91
94
// Set scale width = 300px, height = 300px
92
95
$params->addScale(300, 300);
96
+ // Set scale width = 300px, height = 900px + turn 'smart' resizing on (last parameter)
97
+ $paramsObj->addScale(300, 900, true);
93
98
94
99
$creator = Cagoi\Screenshots\ImageCreator();
95
100
// Create full image
@@ -100,15 +105,15 @@ $creator->add('300x0', '<path to save>', '<filename>');
100
105
$creator->add('0x300', '<path to save >', '<filename >');
101
106
// Create image with width = 300px, height = 300px
102
107
$creator->add('300x300', '<path to save >', '<filename >');
108
+ // Create image with width = 300px, height = 900px + 'smart' resizing turned on
109
+ $imageCreatorObj->add('smartx300x900', $params['filePath'], '<filename >');
110
+ // Send the task
103
111
$client->makeScreenshot($params, $adapter, $creator);
104
112
```
105
113
106
114
``` php
107
- // Using logger
115
+ // Logger usage
108
116
$client = new Cagoi\Screenshots\Client('http://server.com', 'clientKey');
109
117
$client->setLogger(new Cagoi\Screenshots\Logger\FileLogger("<path to logs directory >"));
110
118
...
111
119
```
112
-
113
-
114
-
0 commit comments