-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRecognizeGet.php
More file actions
43 lines (33 loc) · 1.07 KB
/
RecognizeGet.php
File metadata and controls
43 lines (33 loc) · 1.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<?php
use Aspose\BarCode\Configuration;
use Aspose\BarCode\RecognizeApi;
use Aspose\BarCode\Model\DecodeBarcodeType;
use Aspose\BarCode\Requests\RecognizeRequestWrapper;
require_once 'vendor/autoload.php';
function makeConfiguration()
{
$config = new Configuration();
$envToken = getenv('TEST_CONFIGURATION_ACCESS_TOKEN');
if (empty($envToken)) {
$config->setClientId("Client Id from https://dashboard.aspose.cloud/applications");
$config->setClientSecret("Client Secret from https://dashboard.aspose.cloud/applications");
} else {
$config->setAccessToken($envToken);
}
return $config;
}
function main()
{
$recognizeApi = new RecognizeApi(null, makeConfiguration());
$request = new RecognizeRequestWrapper(
DecodeBarcodeType::QR,
"https://products.aspose.app/barcode/scan/img/how-to/scan/step2.png"
);
$result = $recognizeApi->recognize($request);
echo sprintf(
"File '%s' recognized, result: '%s'\n",
"step2.png",
$result->getBarcodes()[0]->getBarcodeValue()
);
}
main();