aspose / cloud-bundle
这是一个用于在symfony2应用程序中快速、轻松使用Aspose云服务的symfony2包。Aspose for Cloud是一个REST API,可以处理包括文档处理文档、电子表格、演示文稿、PDF和图像在内的多种文件格式。
dev-master
2018-10-02 04:45 UTC
Requires
- aspose/cloud-sdk-php: ~1.3
- symfony/framework-bundle: >=2.0
This package is not auto-updated.
Last update: 2024-09-14 15:16:32 UTC
README
#Aspose Cloud for Symfony
此包允许你在Symfony应用程序中使用Aspose Cloud SDK
安装
将以下行添加到你的composer.json文件中
// composer.json { require: { "aspose/cloud-bundle": "~0.3" }, "prefer-stable": true, }
通过在你的composer.json文件所在的目录中运行composer update
来安装新的依赖项。
更新你的AppKernel.php
文件,注册新的包
// app/AppKernel.php public function registerBundles() { // ... new Aspose\Bundle\CloudBundle\AsposeCloudBundle(), // ... ); }
将你的Aspose API密钥添加到配置中
// 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
使用方法
要配置AsposeApp
静态字段中的初始凭据,首先从容器中获取它
// Bundle/Controller/DemoController.php $app = $this->get('aspose.app'); $wordConverter = $this->get('aspose.wordsconverter'); $wordConverter->setFilename($absolutePath) ->convert();