aspose/cloud-bundle

This is a symfony2 bundle to use Aspose cloud service in symfony2 applications quickly and easily. Aspose for Cloud is a REST API to work with a number of file formats including word precessing documents, spreadsheets, presentations, PDFs and images.


Keywords
sdk, cloud, aspose
License
MIT

Documentation

PHP version

Aspose Cloud for Symfony

This bundle allows you to work with Aspose Cloud SDK in your Symfony applications

Installation

Add the following lines to your composer.json file:

// composer.json
{
    require: {
        "aspose/cloud-bundle": "~0.3"
    },
    "prefer-stable": true,
}

Install the new dependencies by running composer update from the directory where your composer.json file is located.

Update your AppKernel.php by registering the new bundle:

// app/AppKernel.php
public function registerBundles()
{
    // ...
     new Aspose\Bundle\CloudBundle\AsposeCloudBundle(),
    // ...
);
}

Add you Aspose API key to your config

// app/config/config.yml

aspose_cloud:
    url: http://api.aspose.com/v1.1
    app:
        sid: yoursidhere
        key: yourkeyhere
        outputLocation: "%kernel.cache_dir%/aspose_cloud/" # let the API save files in the cache directory by default

Usage

To configure the initial credentials in the static fields of the AsposeApp, first get it from the container

// Bundle/Controller/DemoController.php
$app = $this->get('aspose.app');

$wordConverter = $this->get('aspose.wordsconverter');
$wordConverter->setFilename($absolutePath)
              ->convert();