- API version: 3.0
- Package version: 24.11.0
- Supported PHP versions: ">=7.4 || >=8.0"
Scan QR | Generate Barcode | Recognize Barcode |
---|---|---|
Generate Wi-Fi QR | Embed Barcode | Scan Barcode |
Aspose.BarCode for Cloud is a REST API for Linear, 2D and postal barcode generation and recognition in the cloud. API recognizes and generates barcode images in a variety of formats. Barcode REST API allows to specify barcode image attributes like image width, height, border style and output image format in order to customize the generation process. Developers can also specify the barcode type and text attributes such as text location and font styles in order to suit the application requirements.
This repository contains Aspose.BarCode Cloud SDK for PHP source code.
To use these SDKs, you will need Client Id and Client Secret which can be looked up at Aspose Cloud Dashboard (free registration in Aspose Cloud is required for this).
You can either directly use it in your project via source code or get Packagist distribution (recommended).
barcode-cloud-php is available on Packagist as the
barcode-cloud-php
package. Run the following command:
composer require aspose/barcode-cloud-php
To use the SDK, use Composer's autoload:
require __DIR__ . '/vendor/autoload.php';
<?php
declare(strict_types=1);
require __DIR__ . '/vendor/autoload.php';
use Aspose\BarCode\Configuration;
use Aspose\BarCode\BarcodeApi;
use Aspose\BarCode\Requests\GetBarcodeGenerateRequest;
use Aspose\BarCode\Model\{EncodeBarcodeType, CodeLocation};
$config = new Configuration();
$config->setClientId('ClientId from https://dashboard.aspose.cloud/applications');
$config->setClientSecret('Client Secret from https://dashboard.aspose.cloud/applications');
if (getenv("TEST_CONFIGURATION_ACCESS_TOKEN")) {
$config->setAccessToken(getenv("TEST_CONFIGURATION_ACCESS_TOKEN"));
}
$request = new GetBarcodeGenerateRequest(EncodeBarcodeType::QR, 'PHP SDK Test');
$request->format = 'png';
$request->text_location = CodeLocation::None;
$api = new BarcodeApi(null, $config);
$response = $api->GetBarCodeGenerate($request);
$type = 'image/png';
$size = $response->getSize();
header("Content-Type: $type");
header("Content-Length: $size");
echo $response->fread($size);
All Aspose.BarCode for Cloud SDKs, helper scripts and templates are licensed under MIT License.
All URIs are relative to https://api.aspose.cloud/v3.0
Class | Method | HTTP request | Description |
---|---|---|---|
BarcodeApi | getBarcodeGenerate | GET /barcode/generate | Generate barcode. |
BarcodeApi | getBarcodeRecognize | GET /barcode/{name}/recognize | Recognize barcode from a file on server. |
BarcodeApi | postBarcodeRecognizeFromUrlOrContent | POST /barcode/recognize | Recognize barcode from an url or from request body. Request body can contain raw data bytes of the image with content-type "application/octet-stream". An image can also be passed as a form field. |
BarcodeApi | postGenerateMultiple | POST /barcode/generateMultiple | Generate multiple barcodes and return in response stream |
BarcodeApi | putBarcodeGenerateFile | PUT /barcode/{name}/generate | Generate barcode and save on server (from query params or from file with json or xml content) |
BarcodeApi | putBarcodeRecognizeFromBody | PUT /barcode/{name}/recognize | Recognition of a barcode from file on server with parameters in body. |
BarcodeApi | putGenerateMultiple | PUT /barcode/{name}/generateMultiple | Generate image with multiple barcodes and put new file on server |
BarcodeApi | scanBarcode | POST /barcode/scan | Quickly scan a barcode from an image. |
FileApi | copyFile | PUT /barcode/storage/file/copy/{srcPath} | Copy file |
FileApi | deleteFile | DELETE /barcode/storage/file/{path} | Delete file |
FileApi | downloadFile | GET /barcode/storage/file/{path} | Download file |
FileApi | moveFile | PUT /barcode/storage/file/move/{srcPath} | Move file |
FileApi | uploadFile | PUT /barcode/storage/file/{path} | Upload file |
FolderApi | copyFolder | PUT /barcode/storage/folder/copy/{srcPath} | Copy folder |
FolderApi | createFolder | PUT /barcode/storage/folder/{path} | Create the folder |
FolderApi | deleteFolder | DELETE /barcode/storage/folder/{path} | Delete folder |
FolderApi | getFilesList | GET /barcode/storage/folder/{path} | Get all files and folders within a folder |
FolderApi | moveFolder | PUT /barcode/storage/folder/move/{srcPath} | Move folder |
StorageApi | getDiscUsage | GET /barcode/storage/disc | Get disc usage |
StorageApi | getFileVersions | GET /barcode/storage/version/{path} | Get file versions |
StorageApi | objectExists | GET /barcode/storage/exist/{path} | Check if file or folder exists |
StorageApi | storageExists | GET /barcode/storage/{storageName}/exist | Check if storage exists |
- ApiError
- ApiErrorResponse
- AustralianPostParams
- AutoSizeMode
- AvailableGraphicsUnit
- AztecEncodeMode
- AztecParams
- AztecSymbolMode
- BarcodeResponse
- BarcodeResponseList
- BorderDashStyle
- CaptionParams
- ChecksumValidation
- CodabarChecksumMode
- CodabarParams
- CodabarSymbol
- CodablockParams
- Code128Emulation
- Code128EncodeMode
- Code128Params
- Code16KParams
- CodeLocation
- CouponParams
- CustomerInformationInterpretingType
- DataBarParams
- DataMatrixEccType
- DataMatrixEncodeMode
- DataMatrixParams
- DataMatrixVersion
- DecodeBarcodeType
- DiscUsage
- DotCodeEncodeMode
- DotCodeParams
- ECIEncodings
- EnableChecksum
- EncodeBarcodeType
- Error
- ErrorDetails
- FileVersions
- FilesList
- FilesUploadResult
- FontMode
- FontParams
- FontStyle
- GeneratorParams
- GeneratorParamsList
- HanXinEncodeMode
- HanXinErrorLevel
- HanXinParams
- HanXinVersion
- ITF14BorderType
- ITFParams
- MacroCharacter
- MaxiCodeEncodeMode
- MaxiCodeMode
- MaxiCodeParams
- ObjectExist
- Padding
- PatchCodeParams
- PatchFormat
- Pdf417CompactionMode
- Pdf417ErrorLevel
- Pdf417MacroTerminator
- Pdf417Params
- PostalParams
- PresetType
- QREncodeMode
- QREncodeType
- QRErrorLevel
- QRVersion
- QrParams
- ReaderParams
- RegionPoint
- ResultImageInfo
- StorageExist
- StorageFile
- StructuredAppend
- TextAlignment
- FileVersion