Skip to content

Commit ad43767

Browse files
Update README.md
1 parent c858194 commit ad43767

File tree

1 file changed

+6
-36
lines changed

1 file changed

+6
-36
lines changed

README.md

Lines changed: 6 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -70,45 +70,15 @@ require_once('vendor/autoload.php');
7070

7171
Please, look at [Examples](https://github.com/aspose-diagram-cloud/aspose-diagram-cloud-php/blob/master/EXAMPLES.md) document for basic usage or use the [Examples](https://github.com/aspose-diagram-cloud/aspose-diagram-cloud-php/blob/master/Examples) folder for more sophisticated scenarios.
7272

73-
## Use PHP Code to Convert VDX Diagram to other Formats
73+
74+
## Create New VDX Diagram File in PHP
7475

7576
```php
76-
require_once(__DIR__ . '/vendor/autoload.php');
77-
require_once(__DIR__ . '/Utils.php');
78-
79-
use Aspose\Diagram\Cloud\Api\DiagramFileApi;
80-
use \Aspose\Diagram\Cloud\Configuration;
81-
use \Aspose\Diagram\Cloud\Model;
82-
use \Aspose\Diagram\Cloud\ObjectSerializer;
83-
84-
class DiagramFile {
85-
86-
public $diagramApi;
87-
88-
public function __construct() {
89-
$this->diagramApi = new DiagramFileApi();
90-
$config = $this->diagramApi->getConfig();
91-
$token = Utils::getAccessToken();
92-
$config ->setAccessToken($token);
93-
}
94-
95-
public function saveFileAsAnotherFormat() {
96-
$fileName ='file_get_1.vdx';
97-
$isOverwrite = 'true';
98-
$folder= "";
99-
$format = new \Aspose\Diagram\Cloud\Model\FileFormatRequest();
100-
$format->setFormat("pdf");
101-
$newfilename = "file_saveas_php.pdf";
102-
$result = $this->diagramApi->DiagramFilePostSaveAs($fileName, $format, $newfilename, $folder, $isOverwrite);
103-
$json = json_decode($result);
104-
print_r ( $json );
105-
}
106-
}
107-
108-
$diagramFile = new DiagramFile();
109-
$diagramFile->saveFileAsAnotherFormat();
110-
```
77+
// Get your ClientId and ClientSecret from https://dashboard.aspose.cloud (free registration required).
78+
$api = new DiagramApi("client_credentials", "MY_CLIENT_ID", "MY_CLIENT_SECRET");
11179

80+
$result = $api->createNew("sample.vdx");
81+
```
11282
## Aspose.Diagram Cloud SDKs in Popular Languages
11383

11484
| .NET | Java | PHP | Python | Ruby | Node.js | Android | Perl | Swift |

0 commit comments

Comments
 (0)