123456789101112131415161718192021222324252627282930313233 |
- <?php
- require dirname(__FILE__, 2) . '/vendor/autoload.php';
- $secretId = "SECRETID";
- $secretKey = "SECRETKEY";
- $region = "ap-beijing";
- $cosClient = new Qcloud\Cos\Client(
- array(
- 'region' => $region,
- 'schema' => 'https',
- 'credentials'=> array(
- 'secretId' => $secretId ,
- 'secretKey' => $secretKey)));
- try {
-
- $result = $cosClient->opticalOcrRecognition(array(
- 'Bucket' => 'examplebucket-125000000',
- 'Key' => 'test01.pdf',
- 'CiProcess' => 'OCR',
- 'Type' => 'general',
- 'LanguageType' => 'zh',
- 'IsPDF' => 'true',
- 'PdfPageNumber' => 2,
- 'IsWord' => 'true',
- 'EnableWordPolygon' => 'false',
- ));
-
- print_r($result);
- } catch (\Exception $e) {
-
- echo($e);
- }
|