Skip to content

Commit 539104c

Browse files
committed
Updated sources
1 parent f073204 commit 539104c

53 files changed

Lines changed: 379 additions & 232 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 53 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,27 @@
1-
![](https://img.shields.io/badge/api-v1.0-lightgrey) ![Packagist Version](https://img.shields.io/packagist/v/groupdocscloud/groupdocs-editor-cloud) ![Packagist PHP Version Support](https://img.shields.io/packagist/php-v/groupdocscloud/groupdocs-editor-cloud) [![GitHub license](https://img.shields.io/github/license/groupdocs-editor-cloud/groupdocs-editor-cloud-php)](https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-php/blob/master/LICENSE)
1+
# GroupDocs.Editor Cloud SDK for PHP
2+
This repository contains GroupDocs.Editor Cloud SDK for PHP source code. This SDK allows you to work with GroupDocs.Editor Cloud REST APIs in your PHP applications.
23

3-
# PHP SDK to Document Editor REST API
4+
GroupDocs.Editor Cloud allows you to edit documents across wide range of supported document types:
5+
* Microsoft Word documents - DOC, DOCX, DOCM, DOT, DOTM, DOTX, RTF, FlatOpc, WordML, TXT;
6+
* Microsoft Excel spreadsheets - XLS, XLSX, XLSM, XLT, XLTX, XLTM, XLSB, SpreadsheetML, CSV, TSV;
7+
* Microsoft PowerPoint presentations - PPT, PPTX, PPTM, POT, PPS etc.;
8+
* Open Document formats - ODT, OTT, ODS, ODP, OTP;
9+
* Markup - HTML, MHTML, XML.
10+
## Dependencies
11+
- PHP 5.5 or later
412

5-
[GroupDocs.Editor Cloud SDK for PHP](https://products.groupdocs.cloud/editor/php) wraps GroupDocs.Editor RESTful API so you may integrate Document Editing features in your own apps with zero initial cost.
13+
## Authorization
14+
To use SDK you need AppSID and AppKey authorization keys. You can get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
615

7-
GroupDocs.Editor Cloud API allows the developers to edit most popular document formats using front-end WYSIWYG editors - without needing the applications like OpenOffice or Microsoft Office. Just load documents via GroupDocs.Editor into any WYSIWYG editor, edit document in a way you want and save it back to original document format.
16+
## Installation & Usage
17+
### Composer
818

9-
## Document Editing in the Cloud
10-
11-
GroupDocs.Editor Cloud provides a set of options to customize the editing process dependending on the document type.
12-
13-
- **Word Processing:** Edit document in a flow or paged mode, consider language information for multi-language document editing, manage font extraction to provide the same document editing and appearance behavior in different environments.
14-
- **Spreadsheets:** Supports multi-tabbed spreadsheet editing with the ability to specify the index of the currently edited worksheet.
15-
- **Comma-Separated & Tab-Separated Values:** Specify separator, flexible numeric and dates conversion, memory usage optimization for large files.
16-
- **Markup:** Fix incorrect document structure, URI & e-mail address recognition, highlight and formatting options.
17-
18-
### Document Information Extraction
19-
20-
GroupDocs.Editor Cloud also provides the ability to extract basic information about the edited document.
21-
22-
- Document type
23-
- Document size
24-
- Pages count
25-
26-
Check out the [Developer's Guide](https://docs.groupdocs.cloud/editor/developer-guide/) to know more about GroupDocs.Editor REST API.
27-
28-
## Microsoft Office Formats
29-
30-
**Microsoft Word:** DOC, DOCX, DOCM, DOT, DOTM, DOTX, RTF, FlatOpc, WordML\
31-
**Microsoft Excel:** XLS, XLSX, XLSM, XLT, XLTX, XLTM, XLSB, XLAM, SpreadsheetML\
32-
**Microsoft PowerPoint:** PPT, PPTX, PPTM, PPS, PPSX, PPSM, POT, POTX, POTM
33-
34-
## Other Formats
35-
36-
**OpenDocument:** ODT, OTT, ODP, OTP, ODS, FODS\
37-
**Markup:** HTML, XML\
38-
**Others:** SXC, DIF, DSV, TXT, CSV, TSV
39-
40-
## Get Started with GroupDocs.Editor Cloud SDK for PHP
41-
42-
First create an account at [GroupDocs for Cloud](https://dashboard.groupdocs.cloud/) and get your application information. Next, follow the installation steps as given below.
43-
44-
### Installation via Composer
45-
46-
The package is available at [Packagist](https://packagist.org/) and can be installed via [Composer](http://getcomposer.org/) by executing the following command.
19+
The package is available at [Packagist](https://packagist.org/) and it can be installed via [Composer](http://getcomposer.org/) by executing following command:
4720
```
4821
composer require groupdocscloud/groupdocs-editor-cloud
4922
```
5023

51-
Alternatively, add the following to `composer.json` to install SDK via [Composer](http://getcomposer.org/) directly from this repository.
24+
Or you can install SDK via [Composer](http://getcomposer.org/) directly from this repository, add the following to `composer.json`:
5225

5326
```
5427
{
@@ -68,78 +41,59 @@ Then run `composer install`
6841

6942
### Manual Installation
7043

71-
Clone or download this repository, then run `composer install` in the root directory to install dependencies and include `autoload.php` into your code file.
44+
Clone or download this repository, then run `composer install` in the root directory to install dependencies and include `autoload.php` into your code file:
7245

7346
```php
7447
require_once('/path/to/groupdocs-editor-cloud-php/vendor/autoload.php');
7548
```
7649

77-
### Tests
50+
## Tests
7851

79-
Set your application information in [json.config](tests/GroupDocs/Editor/config.json) and execute following commands to run the tests.
52+
To run the unit tests set your AppSID and AppKey in [json.config](tests/GroupDocs/Editor/config.json) and execute following commands:
8053

8154
```
8255
php composer.phar install
8356
./vendor/bin/phpunit
8457
```
8558

86-
## Edit Word Document in the Cloud via PHP
59+
## Getting Started
60+
Please follow the [installation procedure](#installation--usage) and then run the following:
8761

8862
```php
89-
// For complete examples and data files, please go to https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-php-samples
90-
use GroupDocs\Editor\Model;
91-
use GroupDocs\Editor\Model\Requests;
92-
93-
// Get your application from https://dashboard.groupdocs.cloud
94-
$AppSid = "";
95-
$AppKey = "";
96-
63+
<?php
64+
65+
require_once(__DIR__ . '/vendor/autoload.php');
66+
67+
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required).
9768
$configuration = new GroupDocs\Editor\Configuration();
98-
$configuration->setAppSid($AppSid);
99-
$configuration->setAppKey($AppKey);
100-
101-
$editApi = new GroupDocs\Editor\EditApi($configuration);
102-
$fileApi = new GroupDocs\Editor\FileApi($configuration);
103-
104-
// The document already uploaded into the storage
105-
// Load it into editable state
106-
$fileInfo = new Model\FileInfo();
107-
$fileInfo->setFilePath("WordProcessing/password-protected.docx");
108-
$fileInfo->setPassword("password");
109-
$loadOptions = new Model\WordProcessingLoadOptions();
110-
$loadOptions->setFileInfo($fileInfo);
111-
$loadOptions->setOutputPath("output");
112-
$loadResult = $editApi->load(new Requests\loadRequest($loadOptions));
113-
114-
// Download html document
115-
$htmlFile = $fileApi->downloadFile(new Requests\downloadFileRequest($loadResult->getHtmlPath()));
116-
$html = file_get_contents($htmlFile->getRealPath());
117-
118-
// Edit something...
119-
$html = str_replace("Sample test text", "Hello world", $html);
120-
121-
// Upload html back to storage
122-
file_put_contents($htmlFile->getRealPath(), $html);
123-
$uploadRequest = new Requests\uploadFileRequest($loadResult->getHtmlPath(), $htmlFile->getRealPath());
124-
$fileApi->uploadFile($uploadRequest);
125-
126-
// Save html back to docx
127-
$saveOptions = new Model\WordProcessingSaveOptions();
128-
$saveOptions->setFileInfo($fileInfo);
129-
$saveOptions->setOutputPath("output/edited.docx");
130-
$saveOptions->setHtmlPath($loadResult->getHtmlPath());
131-
$saveOptions->setResourcesPath($loadResult->getResourcesPath());
132-
$saveResult = $editApi->save(new Requests\saveRequest($saveOptions));
133-
134-
// Done.
135-
echo "Document edited: " . $saveResult->getPath();
69+
$configuration->setAppSid("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
70+
$configuration->setAppKey("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
71+
72+
$infoApi = new GroupDocs\Editor\InfoApi($configuration);
73+
74+
try {
75+
$response = $infoApi->getSupportedFileFormats();
76+
77+
foreach ($response->getFormats() as $key => $format) {
78+
echo $format->getFileFormat() . " - " . $format->getExtension(), "\n";
79+
}
80+
} catch (Exception $e) {
81+
echo "Something went wrong: ", $e->getMessage(), "\n";
82+
PHP_EOL;
83+
}
84+
85+
?>
13686
```
13787

138-
## GroupDocs.Editor Cloud SDKs in Popular Languages
88+
## Licensing
89+
GroupDocs.Editor Cloud SDK for PHP is licensed under [MIT License](LICENSE).
13990

140-
| .NET | Java | PHP | Python | Ruby | Node.js | Android |
141-
|---|---|---|---|---|---|---|
142-
| [GitHub](https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-dotnet) | [GitHub](https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-java) | [GitHub](https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-php) | [GitHub](https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-python) | [GitHub](https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-ruby) | [GitHub](https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-node) | [GitHub](https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-android) |
143-
| [NuGet](https://www.nuget.org/packages/GroupDocs.Editor-Cloud/) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-editor-cloud) | [Composer](https://packagist.org/packages/groupdocscloud/groupdocs-editor-cloud) | [PIP](https://pypi.org/project/groupdocs-editor-cloud/) | [GEM](https://rubygems.org/gems/groupdocs_editor_cloud) | [NPM](https://www.npmjs.com/package/groupdocs-editor-cloud) | [Maven](https://repository.groupdocs.cloud/webapp/#/artifacts/browse/tree/General/repo/com/groupdocs/groupdocs-editor-cloud-android) |
91+
## Resources
92+
+ [**Website**](https://www.groupdocs.cloud)
93+
+ [**Product Home**](https://products.groupdocs.cloud/editor)
94+
+ [**Documentation**](https://docs.groupdocs.cloud/display/editorcloud/Home)
95+
+ [**Free Support Forum**](https://forum.groupdocs.cloud/c/editor)
96+
+ [**Blog**](https://blog.groupdocs.cloud/category/editor)
14497

145-
[Home](https://www.groupdocs.cloud/) | [Product Page](https://products.groupdocs.cloud/editor/php) | [Documentation](https://docs.groupdocs.cloud/editor/) | [Live Demo](https://products.groupdocs.app/editor/total) | [API Reference](https://apireference.groupdocs.cloud/editor/) | [Code Samples](https://github.com/groupdocs-editor-cloud/groupdocs-editor-cloud-php-samples) | [Blog](https://blog.groupdocs.cloud/category/editor/) | [Free Support](https://forum.groupdocs.cloud/c/editor) | [Free Trial](https://dashboard.groupdocs.cloud)
98+
## Contact Us
99+
Your feedback is very important to us. Please feel free to contact us using our [Support Forums](https://forum.groupdocs.cloud/c/editor).

composer.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"description": "This repository contains GroupDocs.Editor Cloud SDK for PHP source code.",
3-
"name": "groupdocscloud/groupdocs-editor-cloud",
4-
"version": "19.11",
3+
"name": "groupdocscloud/groupdocs-editor-cloud",
4+
"version": "21.7",
55
"license": "MIT",
66
"type": "library",
77
"keywords": [
@@ -41,7 +41,7 @@
4141
"psr-4": { "GroupDocs\\Editor\\" : "src/" }
4242
},
4343
"autoload-dev": {
44-
"classmap": [ "src/", "tests/" ],
44+
"classmap": [ "src/", "tests/" ],
4545
"psr-4": { "GroupDocs\\Editor\\" : "tests/" }
4646
}
47-
}
47+
}

0 commit comments

Comments
 (0)