Free Support Forum -

Create / Generate Bubble Sheet (OMR) Template in PHP using Aspose.OMR REST API throws error


Today we got the following error while generating OMR template

InvalidArgumentException: invalid value for ewogICAgIlZlcnNpb24iOiAxLjAsIAogICAgIk5hbWUiOiAib21…AgICAgICAgICAgICAgICJCdWJibGVXaWR0aCI6IDYxCiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIF0KICAgICAgICB9CiAgICBdCn0= when calling FileInfo., must conform to the pattern /^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/. in /home/

However if we decode the string given in the error it gets decoded without any problem. Why is this error coming?

Please help.


We are sorry for your inconvenience. We will appreciate it if you please share your sample code and template source file here to replicate the issue at our end. We will investigate the issue and will guide you accordingly.

Code is written in Yii2 Framework. Few days ago this code was working.
Download The code: (2.5 KB)


I’m afraid I’m unable to test your sample code. However, We have not made any changes in our API recently. Aspose.OMR Cloud PHP Demo is working fine at our end. Please find sample PHP (1.4 KB) to generate Template using (14.8 KB). You can customize it as per your requirements.

You can not test my code because it is part of our software. You can not even test any code if it has been integrated in a software. Just tell me why that string is not getting validated? What is wrong with the string?

If we try to base64decode it successfully decodes into json data. Then why your sdk class is not able to decode it?


Our template is like this.


?text=Booklet ID: [495] Test: test/test/My Omr

?text=Mobile__________________________________ Date____________


Even on your demo files I am getting the same error
(I have only changed the API keys and template files)


Thanks for sharing the template generation markup. We have noticed the reported issue and logged a ticket OMRCLOUD-32 for further investigation and rectification. We will notify you as soon as it is resolved.

Any update ?


Thanks for your patience. We have fixed your above reported issue and pushed the changes to GitHub repository. It should work now. Furthermore, we will update the PHP package on Packagist shortly.

I have installed your SDK using composer. So I think it needs the package from Packagist.
When will you update the package in Packagist? I am waiting.
In Packagist it is still saying Version 18.8 (2018-08-29 18:12 UTC)


Thanks for your feedback. We have pushed the updated PHP SDK package to Packagist as well.