Skip to content

Instantly share code, notes, and snippets.

@aspose-cloud
Last active December 19, 2020 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aspose-cloud/3beac24bdea025c4aad5a2f1ea81be9f to your computer and use it in GitHub Desktop.
Save aspose-cloud/3beac24bdea025c4aad5a2f1ea81be9f to your computer and use it in GitHub Desktop.
This Gist repository contains code snippet related to Aspose.OMR Cloud SDK for PHP
Aspose.OMR-Cloud-SDK-PHP
<?
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-php/
if (! $this->storage->uploadFile($imageFilePath))
throw new \Exception("Unable to upload file {$imageFilePath}");
$imageName = basename($imageFilePath);
$param = new AsposeOmr\Model\OMRFunctionParam();
$param->setFunctionParam($this->serializeFiles([$templateFilePath]));
$response = $this->omrApi->postRunOmrTask($imageName, "CorrectTemplate", $param);
return $this->checkOMRReponse($response, 'CorrectTemplate');
<?
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-php/
if (! $this->storage->uploadFile($correctedTemplateFilePath))
throw new \Exception("Unable to upload file {$correctedTemplateFilePath}");
$correctedTemplateFileName = basename($correctedTemplateFilePath);
$param = new AsposeOmr\Model\OMRFunctionParam();
$param->setFunctionParam($templateId);
$response = $this->omrApi->postRunOmrTask($correctedTemplateFileName, "FinalizeTemplate", $param);
return $this->checkOMRReponse($response, 'FinalizeTemplate');
<?
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-php/
if (! $this->storage->uploadFile($templateFilePath))
throw new \Exception("Unable to upload file {$templateFilePath}");
$templateName = basename($templateFilePath);
$param = new AsposeOmr\Model\OMRFunctionParam();
$param->setFunctionParam(json_encode(array('ExtraStoragePath' => self::$logosFolderName)));
$response = $this->omrApi->postRunOmrTask($templateName, "GenerateTemplate", $param);
return $this->checkOMRReponse($response, 'GenerateTemplate');
<?
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-php/
if (! $this->storage->uploadFile($imagePath))
throw new \Exception("Unable to upload file {$imagePath}");
$imageName = basename($imagePath);
$param = new AsposeOmr\Model\OMRFunctionParam();
$param->setFunctionParam($templateId);
$response = $this->omrApi->postRunOmrTask($imageName, "RecognizeImage", $param);
return $this->checkOMRReponse($response, 'RecognizeImage');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment