PHP library for communicating with the Aspose.Cells Cloud API
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.settings
TestData
docs
lib
test/Api
.buildpath
.gitignore
.php_cs
.project
.travis.yml
LICENSE
README.md
composer.bat
composer.json
composer.lock
composer.phar
git_push.sh
phpunit.xml.dist

README.md

Aspose.Cells Cloud SDK for PHP

This repository contains Aspose.Cells Cloud SDK for PHP source code. This SDK allows you to work with Aspose.Cells Cloud REST APIs in your PHP applications quickly and easily, with zero initial cost.

Key Features

  • Convert spreadsheets to different formats
  • Create spreadsheets from templates, XML or smart markers
  • Split spreadsheets to single worksheet spreadsheets
  • Manipulate rows, columns, cells & data
  • Set complex formulae
  • Extract charts, pictures, shapes & other objects as images
  • Export worksheets to images

See API Reference for full API specification.

How to use the SDK?

The complete source code is available in this repository folder. You can either directly use it in your project via source code or get Packagist distribution (recommended).

Prerequisites

To use Aspose Cells for Cloud PHP SDK you need to register an account with Aspose Cloud and lookup/create App Key and SID at Cloud Dashboard. There is free quota available. For more details, see Aspose Cloud Pricing.

Installation

Via Composer:

cells-sdk-php is available on Packagist as the cells-sdk-php package. Run the following command:

composer require aspose/cells-sdk-php

To use the SDK, use Composer's autoload:

require_once('vendor/autoload.php');

Sample usage

namespace Aspose\Cells\Cloud;

require_once('vendor\autoload.php');
use Aspose\Cells\Cloud\Api\OAuthApi;
use Aspose\Cells\Cloud\Api\CellsSaveAsApi;

$grantType = "client_credentials";
$clientId = "your clientId";
$clientSecret = "your clientSecret";
$api = new OAuthApi();
$config = $api->getConfig();
$config->setHost('https://api.aspose.cloud');
$accessTokenResponse = $api->oAuthPost($grantType, $clientId, $clientSecret);

$saveAsAPI = new CellsSaveAsApi();
$config = $saveAsAPI->getConfig();
$config->setAccessToken($accessTokenResponse->getAccessToken());

$name ='Book1.xlsx';
$saveOptions = null;
$newfilename = "newbook.xlsx";
$isAutoFitRows= 'true';
$isAutoFitColumns= 'true';
$folder = "Temp";

$result = $saveAsAPI->cellsSaveAsPostDocumentSaveAs($name, $saveOptions, $newfilename,$isAutoFitRows, $isAutoFitColumns, $folder);

Dependencies

  • PHP 5.6 or later
  • referenced packages (see here for more details)

Contact Us

Your feedback is very important to us. Please feel free to contact us using our Support Forums.