Last active
August 31, 2020 08:59
-
-
Save groupdocscloud/8db205dcff0fe84f155e4aa371c0b4f4 to your computer and use it in GitHub Desktop.
This Gist contains PHP examples of GroupDocs.Storage Cloud
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Storage-PHP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "one-page.docx"; | |
$versionId = null; | |
$storage = "MyStorage"; | |
$request = new Requests\DeleteFileRequest($path, $versionId, $storage); | |
$response = $storageApi->deleteFile($request); | |
echo "File Deleted."; | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "one-page.docx"; | |
$versionId = null; | |
$storage = "MyDropBoxStorage"; | |
$request = new Requests\DeleteFileRequest($path, $versionId, $storage); | |
$response = $storageApi->deleteFile($request); | |
echo "File Deleted."; | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "mynewphpfolder2"; | |
$storage = "MyStorage"; | |
$recursive = true; | |
$request = new Requests\DeleteFolderRequest($path, $storage, $recursive); | |
$result = $storageApi->deleteFolder($request); | |
echo "Deleted: ", $result->getCode(); | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$storage = "MyStorage"; | |
$request = new Requests\GetDiscUsageRequest($storage); | |
$result = $storageApi->getDiscUsage($request); | |
echo "Disc Usage: ", $result->getDiscUsage(); | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "sample2.mpp"; | |
$versionId = null; | |
$storage = "MyStorage"; | |
$request = new Requests\GetDownloadRequest($path, $versionId, $storage); | |
$result = $storageApi->getDownload($request); | |
echo "Downloaded: ", $result; | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "sample2.mpp"; | |
$versionId = null; | |
$storage = "MyStorage"; | |
$request = new Requests\GetIsExistRequest($path, $versionId, $storage); | |
$result = $storageApi->getIsExist($request); | |
echo "Exists: ", $result->getCode(); | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$name = "MyStorage"; | |
$request = new Requests\GetIsStorageExistRequest($name); | |
$result = $storageApi->getIsStorageExist($request); | |
echo "Exists: ", $result->getCode(); | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "viewerdocs"; | |
$storage = "MyStorage"; | |
$request = new Requests\GetListFilesRequest($path, $storage); | |
$result = $storageApi->getListFiles($request); | |
echo "Files List: ", $result->getCode(); | |
echo "<br>"; | |
echo "Files Found: ", count($result->getFiles()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "viewerdocs/sample.docx"; | |
$storage = "MyStorage"; | |
$request = new Requests\GetListFileVersionsRequest($path, $storage); | |
$result = $storageApi->getListFileVersions($request); | |
echo "Files List Version: ", $result->getCode(); | |
echo "<br>"; | |
echo "Files Found: ", count($result->getFileVersions()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$src = "sample.mpp"; | |
$dest = "sample2.mpp"; | |
$versionId = null; | |
$storage = "MyStorage"; | |
$destStorage = "MyStorage"; | |
$request = new Requests\PostMoveFileRequest($src, $dest, $versionId, $storage, $destStorage); | |
$result = $storageApi->postMoveFile($request); | |
echo "File Moved."; | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$src = "mynewphpfolder"; | |
$dest = "mynewphpfolder2"; | |
$storage = "MyStorage"; | |
$dest_storage = "MyStorage"; | |
$request = new Requests\PostMoveFolderRequest($src, $dest, $storage, $dest_storage); | |
$result = $storageApi->postMoveFolder($request); | |
echo "Moved: ", $result->getCode(); | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "sample2.mpp"; | |
$versionId = null; | |
$storage = "MyStorage"; | |
$request = new Requests\GetDownloadRequest($path, $versionId, $storage); | |
$result = $storageApi->getDownload($request); | |
$file = $result; | |
$path = "sample4.mpp"; | |
$version_id = null; | |
$request = new Requests\PutCreateRequest($path, $file, $version_id, $storage); | |
$result = $storageApi->putCreate($request); | |
echo "Created: ", $result; | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "sample2.mpp"; | |
$versionId = null; | |
$storage = "MyStorage"; | |
$request = new Requests\GetDownloadRequest($path, $versionId, $storage); | |
$result = $storageApi->getDownload($request); | |
$file = $result; | |
$path = "viewerdocs/sample3.mpp"; | |
$version_id = null; | |
$storage = "MyDropBoxStorage"; | |
$request = new Requests\PutCreateRequest($path, $file, $version_id, $storage); | |
$result = $storageApi->putCreate($request); | |
echo "Created: ", $result; | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Storage\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-storage-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Storage\Configuration(); | |
$configuration->setAppSid("XXXX"); | |
$configuration->setAppKey("XXXX-XXX"); | |
$storageApi = new GroupDocs\Storage\Api\StorageApi($configuration); | |
try | |
{ | |
$path = "mynewphpfolder"; | |
$storage = "MyStorage"; | |
$destStorage = "myStorage"; | |
$request = new Requests\PutCreateFolderRequest($path, $storage, $destStorage); | |
$result = $storageApi->PutCreateFolder($request); | |
echo "Created: ", $result->getCode(); | |
echo "<br>"; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Viewer-PHP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->setAttachmentPassword("password"); | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$attachmentPassword="password"; | |
$folder=null; | |
$request = new Requests\HtmlCreateAttachmentPagesCacheRequest($fileName,$attachmentName,$htmlOptions); | |
$request->attachmentPassword = $attachmentPassword; | |
$request->folder = $folder; | |
$response = $viewerApi->htmlCreateAttachmentPagesCache($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getAttachmentName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->setAttachmentPassword("password"); | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$attachmentPassword="password"; | |
$folder=null; | |
$request = new Requests\ImageCreateAttachmentPagesCacheRequest($fileName,$attachmentName,$htmlOptions); | |
$request->attachmentPassword = $attachmentPassword; | |
$request->folder = $folder; | |
$response = $viewerApi->imageCreateAttachmentPagesCache($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getAttachmentName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-XX"); | |
$configuration->setAppKey("XXXX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.DXF"; | |
$cadOptions = new \GroupDocs\Viewer\Model\CadOptions(); | |
$cadOptions->layers = array("SLD-0", "DEFAULT_3"); | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->setEmbedResources(true); | |
$htmlOptions->cadOptions = $cadOptions; | |
$request = new Requests\HtmlCreatePagesCacheRequest($fileName); | |
$request->htmlOptions = $htmlOptions; | |
$response = $viewerApi->htmlCreatePagesCache($request); | |
echo "CAD - Pages Count: ", count($response->getPages()); | |
echo "CAD - FileName: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-XX"); | |
$configuration->setAppKey("XXXX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.DXF"; | |
$cadOptions = new \GroupDocs\Viewer\Model\CadOptions(); | |
$cadOptions->layers = array("SLD_0", "DEFAULT_3"); | |
$imageOptions = new \GroupDocs\Viewer\Model\ImageOptions(); | |
$imageOptions->setFormat("jpg"); | |
$imageOptions->setQuality(100); | |
$imageOptions->cadOptions = $cadOptions; | |
$request = new Requests\ImageCreatePagesCacheRequest($fileName); | |
$request->imageOptions = $imageOptions; | |
$response = $viewerApi->imageCreatePagesCache($request); | |
echo "CAD - Pages Count: ", count($response->getPages()); | |
echo "CAD - FileName: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.docx"; | |
$folderName = "viewerdocs"; | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->setEmbedResources(true); | |
$request = new Requests\HtmlCreatePagesCacheRequest($fileName); | |
$request->folder = $folderName; | |
$request->htmlOptions = $htmlOptions; | |
$response = $viewerApi->htmlCreatePagesCache($request); | |
echo "Expected response type is HtmlPageCollection where PageCount is : ", count($response->getPages()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample-one-page.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\ImageCreatePagesCacheRequest($fileName); | |
$request->folder = $folderName; | |
$request->imageOptions = new \GroupDocs\Viewer\Model\ImageOptions(); | |
$request->imageOptions->setFormat("jpg"); | |
$response = $viewerApi->imageCreatePagesCache($request); | |
echo "Expected response type is ImagePageCollection where PageCount is : ", count($response->getPages()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileUrl = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx"; | |
$folderName = null; | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->setEmbedResources(true); | |
$htmlOptions->wordsOptions = new \GroupDocs\Viewer\Model\WordsOptions(); | |
$request = new Requests\HtmlCreatePagesCacheFromUrlRequest($fileUrl, $htmlOptions); | |
$request->folder = $folderName; | |
$response = $viewerApi->htmlCreatePagesCacheFromUrl($request); | |
echo "Expected response type is HtmlPageCollection where PageCount is : ", count($response->getPages()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileUrl = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx"; | |
$folderName = null; | |
$ImageOptions = new \GroupDocs\Viewer\Model\ImageOptions(); | |
$ImageOptions->setFormat("jpg"); | |
$ImageOptions->wordsOptions = new \GroupDocs\Viewer\Model\WordsOptions(); | |
$request = new Requests\ImageCreatePagesCacheFromUrlRequest($fileUrl, $ImageOptions); | |
$request->folder = $folderName; | |
$response = $viewerApi->imageCreatePagesCacheFromUrl($request); | |
echo "Expected response type is ImagePageCollection where PageCount is : ", count($response->getPages()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-XX"); | |
$configuration->setAppKey("XXXX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "one-page.docx"; | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->setEmbedResources(true); | |
$htmlOptions->setEnableMinification(true); | |
$request = new Requests\HtmlCreatePagesCacheRequest($fileName); | |
$request->htmlOptions = $htmlOptions; | |
$response = $viewerApi->htmlCreatePagesCache($request); | |
echo "Minified HTML Pages Count: ", count($response->getPages()); | |
echo "Minified - FileName: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$filePath = "D://one-page.docx"; | |
$fileName = "one-page.docx"; | |
$folderName = "viewerdocs"; | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->setEmbedResources(true); | |
$json_data = file_get_contents($filePath); | |
$file_Json_Data = json_encode($json_data, true); | |
$options_Json_Data = json_encode($htmlOptions->__toString(), true); | |
$request = new Requests\HtmlCreatePagesCacheFromContentRequest($file_Json_Data, $options_Json_Data); | |
$request->folder = $folderName; | |
//$request->fileName = $fileName; | |
$response = $viewerApi->htmlCreatePagesCacheFromContent($request); | |
echo "Number of Pages: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$filePath = "D://one-page.docx"; | |
$fileName = "one-page.docx"; | |
$folderName = "viewerdocs"; | |
$imageOptions = new \GroupDocs\Viewer\Model\ImageOptions(); | |
$imageOptions->setFormat("jpg"); | |
$json_data = file_get_contents($filePath); | |
$file_Json_Data = json_encode($json_data, true); | |
$options_Json_Data = json_encode($imageOptions->__toString(), true); | |
$request = new Requests\ImageCreatePagesCacheFromContentRequest($file_Json_Data, $options_Json_Data); | |
$request->folder = $folderName; | |
$request->fileName = $fileName; | |
$response = $viewerApi->imageCreatePagesCacheFromContent($request); | |
echo "Number of Pages: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileUrl = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx"; | |
$folderName = "viewerdocs"; | |
$pdfFileOptions = new \GroupDocs\Viewer\Model\PdfFileOptions(); | |
$pdfFileOptions->wordsOptions = new \GroupDocs\Viewer\Model\WordsOptions(); | |
$request = new Requests\HtmlCreatePdfFileFromUrlRequest( | |
$file->url = $fileUrl, | |
$pdfFileOptions | |
); | |
$request->folder = $folderName; | |
$response = $viewerApi->htmlCreatePdfFileFromUrl($request); | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "PDF File Name: ", $response->getPdfFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileUrl = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx"; | |
$folderName = "viewerdocs"; | |
$pdfFileOptions = new \GroupDocs\Viewer\Model\PdfFileOptions(); | |
$pdfFileOptions->wordsOptions = new \GroupDocs\Viewer\Model\WordsOptions(); | |
$request = new Requests\ImageCreatePdfFileFromUrlRequest( | |
$file->url = $fileUrl, | |
$pdfFileOptions | |
); | |
$request->folder = $folderName; | |
$response = $viewerApi->imageCreatePdfFileFromUrl($request); | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "PDF File Name: ", $response->getPdfFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$filePath = "D://one-page.docx"; | |
$fileName = "one-page.docx"; | |
$folderName = "viewerdocs"; | |
$pdfFileOptions = new \GroupDocs\Viewer\Model\PdfFileOptions(); | |
$json_data = file_get_contents($filePath); | |
$file_Json_Data = json_encode($json_data, true); | |
$options_Json_Data = json_encode($pdfFileOptions->__toString(), true); | |
$request = new Requests\HtmlCreatePdfFileFromContentRequest($file_Json_Data, $options_Json_Data); | |
$request->folder = $folderName; | |
$request->fileName = $fileName; | |
$response = $viewerApi->htmlCreatePdfFileFromContent($request); | |
echo "File Name: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$filePath = "D://one-page.docx"; | |
$fileName = "one-page.docx"; | |
$folderName = "viewerdocs"; | |
$pdfFileOptions = new \GroupDocs\Viewer\Model\PdfFileOptions(); | |
$json_data = file_get_contents($filePath); | |
$file_Json_Data = json_encode($json_data, true); | |
$options_Json_Data = json_encode($pdfFileOptions->__toString(), true); | |
$request = new Requests\ImageCreatePdfFileFromContentRequest($file_Json_Data, $options_Json_Data); | |
$request->folder = $folderName; | |
$request->fileName = $fileName; | |
$response = $viewerApi->imageCreatePdfFileFromContent($request); | |
echo "File Name: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-XX"); | |
$configuration->setAppKey("XXXX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.mpp"; | |
$projectOptions = new \GroupDocs\Viewer\Model\ProjectOptions(); | |
$projectOptions->setPageSize("A4"); | |
$projectOptions->setTimeUnit("Unknown"); | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->setEmbedResources(true); | |
$htmlOptions->projectOptions = $projectOptions; | |
$request = new Requests\HtmlCreatePagesCacheRequest($fileName); | |
$request->htmlOptions = $htmlOptions; | |
$response = $viewerApi->htmlCreatePagesCache($request); | |
echo "Project - Pages Count: ", count($response->getPages()); | |
echo "Project - FileName: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-XX"); | |
$configuration->setAppKey("XXXX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.mpp"; | |
$projectOptions = new \GroupDocs\Viewer\Model\ProjectOptions(); | |
$projectOptions->setPageSize("A4"); | |
$projectOptions->setTimeUnit("Unknown"); | |
$imageOptions = new \GroupDocs\Viewer\Model\ImageOptions(); | |
$imageOptions->setFormat("jpg"); | |
$imageOptions->setQuality(100); | |
$imageOptions->projectOptions = $projectOptions; | |
$request = new Requests\ImageCreatePagesCacheRequest($fileName); | |
$request->imageOptions = $imageOptions; | |
$response = $viewerApi->imageCreatePagesCache($request); | |
echo "Project - Pages Count: ", count($response->getPages()); | |
echo "Project - FileName: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$folder=null; | |
$request = new Requests\HtmlDeleteAttachmentPagesCacheRequest($fileName,$attachmentName,$folder); | |
$response = $viewerApi->htmlDeleteAttachmentPagesCache($request); | |
echo "Document Processed"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$folder=null; | |
$request = new Requests\ImageDeleteAttachmentPagesCacheRequest($fileName,$attachmentName,$folder); | |
$response = $viewerApi->imageDeleteAttachmentPagesCache($request); | |
echo "Document Processed"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$request = new Requests\DeleteFontsCacheRequest(); | |
$response = $viewerApi->deleteFontsCache($request); | |
echo "Fonts Removed"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample-one-page.docx"; | |
$folderName = "viewerdocs"; | |
$pageNumber = 1; | |
$request = new Requests\HtmlGetPageRequest($fileName, $pageNumber); | |
$request->folder = $folderName; | |
$response = $viewerApi->htmlGetPage($request); | |
echo "Expected response type is System.IO.Stream."; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample-one-page.docx"; | |
$folderName = "viewerdocs"; | |
$pageNumber = 1; | |
$request = new Requests\ImageGetPageRequest($fileName, $pageNumber); | |
$request->folder = $folderName; | |
$response = $viewerApi->imageGetPage($request); | |
echo "Expected response type is System.IO.Stream."; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("xxx-xx"); | |
$configuration->setAppKey("xxxx"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "one-page1.docx"; | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->setEmbedResources(true); | |
$htmlOptions->setExcludeFonts(true); | |
$request = new Requests\HtmlGetPagesRequest($fileName); | |
$request->htmlOptions = $htmlOptions; | |
$response = $viewerApi->htmlGetPages($request); | |
echo "Pages Count: ", count($response->getPages()); | |
echo "FileName: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$request = new GroupDocs\Viewer\Model\Requests\GetSupportedFileFormatsRequest(); | |
$response = $viewerApi->getSupportedFileFormats($request); | |
foreach ($response->getFormats() as $key => $format) { | |
echo $format->getFileFormat() . " - " . $format->getExtension(), "\n"; | |
} | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$filename="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$request = new Requests\HtmlGetAttachmentRequest($filename,$attachmentName); | |
$request->folder = null; | |
$response = $viewerApi->htmlGetAttachment($request); | |
echo "Document Processed Successfully"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$filename="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$request = new Requests\ImageGetAttachmentRequest($filename,$attachmentName); | |
$request->folder = null; | |
$response = $viewerApi->imageGetAttachment($request); | |
echo "Document Processed Successfully"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
/* | |
* Initializes a new instance of the HtmlGetAttachmentInfoRequest class. | |
* | |
* @param string $fileName The file name. | |
* @param string $attachmentName The attachment name. | |
* @param string $password The document password. | |
* @param string $attachmentPassword The attachment password. | |
* @param string $folder The folder which contains specified file in storage. | |
* @param string $storage The file storage which have to be used. | |
*/ | |
$fileName="Test.msg"; | |
$attachmentName="Freescale OSC.pdf"; | |
$password=null; | |
$attachmentPassword=null; | |
$folder=null; | |
$storage=null; | |
$request = new Requests\HtmlGetAttachmentInfoRequest($fileName,$attachmentName,$password,$attachmentPassword,$folder,$storage); | |
$response = $viewerApi->htmlGetAttachmentInfo($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "Attachment Extension Name: ", $response->getExtension(); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getFileName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
/* | |
* Initializes a new instance of the ImageGetAttachmentInfoRequest class. | |
* | |
* @param string $fileName The file name. | |
* @param string $attachmentName The attachment name. | |
* @param string $password The document password. | |
* @param string $attachmentPassword The attachment password. | |
* @param string $folder The folder which contains specified file in storage. | |
* @param string $storage The file storage which have to be used. | |
*/ | |
$fileName="Test.msg"; | |
$attachmentName="Freescale OSC.pdf"; | |
$password=null; | |
$attachmentPassword=null; | |
$folder=null; | |
$storage=null; | |
$request = new Requests\ImageGetAttachmentInfoRequest($fileName,$attachmentName,$password,$attachmentPassword,$folder,$storage); | |
$response = $viewerApi->imageGetAttachmentInfo($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "Attachment Extension Name: ", $response->getExtension(); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getFileName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$options = new \GroupDocs\Viewer\Model\DocumentInfoOptions(); | |
$options->setAttachmentPassword("password"); | |
$filename="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$folder=null; | |
$request = new Requests\HtmlGetAttachmentInfoWithOptionsRequest($filename,$attachmentName,$options,$folder); | |
$response = $viewerApi->htmlGetAttachmentInfoWithOptions($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "Attachment Extension Name: ", $response->getExtension(); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getFileName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$options = new \GroupDocs\Viewer\Model\DocumentInfoOptions(); | |
$options->setAttachmentPassword("password"); | |
$filename="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$folder=null; | |
$request = new Requests\ImageGetAttachmentInfoWithOptionsRequest($filename,$attachmentName,$options,$folder); | |
$response = $viewerApi->imageGetAttachmentInfoWithOptions($request); | |
echo "Attachment Pages Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Extension: ", $response->getExtension(); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getFileName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$attachmentPassword="password"; | |
$pageNumber = 1; | |
$folder=null; | |
$request = new Requests\HtmlGetAttachmentPageRequest($fileName,$attachmentName,$pageNumber); | |
$request->attachmentPassword = $attachmentPassword; | |
$request->folder = $folder; | |
$response = $viewerApi->htmlGetAttachmentPage($request); | |
echo "File Processed successfully"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$attachmentPassword="password"; | |
$pageNumber = 1; | |
$folder=null; | |
$request = new Requests\ImageGetAttachmentPageRequest($fileName,$attachmentName,$pageNumber); | |
$request->attachmentPassword = $attachmentPassword; | |
$request->folder = $folder; | |
$response = $viewerApi->imageGetAttachmentPage($request); | |
echo "File Processed successfully"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$attachmentPassword="password"; | |
$folder=null; | |
$getPagesRequest = new Requests\HtmlGetAttachmentPagesRequest($fileName,$attachmentName); | |
$getPagesRequest->attachmentPassword = $attachmentPassword; | |
$getPagesRequest->folder = $folder; | |
$getPagesRequest->startPageNumber = 1; | |
$getPagesRequest->countPages = 1; | |
$getPagesResponse = $viewerApi->htmlGetAttachmentPages($getPagesRequest); | |
echo "Document Pages Processed"; | |
$page = $getPagesResponse->getPages()[0]; | |
foreach ($page->getResources() as $key => $resource) { | |
$getResourceRequest = new Requests\HtmlGetAttachmentPageResourceRequest( | |
$fileName = $fileName, | |
$attachmentName = $attachmentName, | |
$pageNumber = $page->getNumber(), | |
$resourceName = $resource->getName(), | |
$folder = null, | |
$storage = null | |
); | |
$getResourceResponse = $viewerApi->htmlGetAttachmentPageResource($getResourceRequest); | |
} | |
echo "<br>"; | |
echo "Document Page Resources Processed"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$attachmentPassword="password"; | |
$folder=null; | |
$request = new Requests\HtmlGetAttachmentPagesRequest($fileName,$attachmentName); | |
$request->attachmentPassword = $attachmentPassword; | |
$request->folder = $folder; | |
$response = $viewerApi->htmlGetAttachmentPages($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getAttachmentName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$attachmentPassword="password"; | |
$folder=null; | |
$request = new Requests\ImageGetAttachmentPagesRequest($fileName,$attachmentName); | |
$request->attachmentPassword = $attachmentPassword; | |
$request->folder = $folder; | |
$response = $viewerApi->imageGetAttachmentPages($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getAttachmentName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$attachmentPassword="password"; | |
$folder=null; | |
$request = new Requests\HtmlGetZipWithAttachmentPagesRequest($fileName,$attachmentName); | |
$request->resourcePath = "./r/{resource-name}"; | |
$request->attachmentPassword = $attachmentPassword; | |
$request->folder = $folder; | |
$response = $viewerApi->htmlGetZipWithAttachmentPages($request); | |
echo "File Processed successfully"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="with-attachment.msg"; | |
$attachmentName="password-protected.docx"; | |
$attachmentPassword="password"; | |
$folder=null; | |
$request = new Requests\ImageGetZipWithAttachmentPagesRequest($fileName,$attachmentName); | |
$request->resourcePath = "./r/{resource-name}"; | |
$request->attachmentPassword = $attachmentPassword; | |
$request->folder = $folder; | |
$response = $viewerApi->imageGetZipWithAttachmentPages($request); | |
echo "File Processed successfully"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$request = new Requests\HtmlGetAttachmentsRequest("with-attachment.msg"); | |
$request->folder = null; | |
$response = $viewerApi->htmlGetAttachments($request); | |
echo "Attachment Count: ", count($response->getAttachments()); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getAttachments()[0]->getName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$filename="with-attachment.msg"; | |
$request = new Requests\ImageGetAttachmentsRequest($filename); | |
$request->folder = null; | |
$response = $viewerApi->imageGetAttachments($request); | |
echo "Attachment Count: ", count($response->getAttachments()); | |
echo "<br>"; | |
echo "Attachment Name: ", $response->getAttachments()[0]->getName(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-XX"); | |
$configuration->setAppKey("XXXX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.DXF"; | |
$request = new Requests\HtmlGetDocumentInfoRequest($fileName); | |
$response = $viewerApi->htmlGetDocumentInfo($request); | |
echo "CAD Layers Count: ", count($response->getLayers()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-XX"); | |
$configuration->setAppKey("XXXX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.DXF"; | |
$request = new Requests\ImageGetDocumentInfoRequest($fileName); | |
$response = $viewerApi->imageGetDocumentInfo($request); | |
echo "CAD Layers Count: ", count($response->getLayers()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="Annotated_docx.docx"; | |
$folder=null; | |
$request = new Requests\HtmlGetDocumentInfoRequest($fileName); | |
$request->folder = $folder; | |
$response = $viewerApi->htmlGetDocumentInfo($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "File Extension: ", $response->getExtension(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="Annotated_docx.docx"; | |
$folder=null; | |
$request = new Requests\ImageGetDocumentInfoRequest($fileName); | |
$request->folder = $folder; | |
$response = $viewerApi->imageGetDocumentInfo($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "File Extension: ", $response->getExtension(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$url="https://www.dropbox.com/s/j260ve4f90h1p41/one-page.docx?dl=1"; | |
$fileName="one-page-url.docx"; | |
$folder=null; | |
$request = new Requests\HtmlGetDocumentInfoFromUrlRequest($url); | |
$request->fileName =$fileName; | |
$request->folder = $folder; | |
$response = $viewerApi->htmlGetDocumentInfoFromUrl($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "File Extension: ", $response->getExtension(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$url="https://www.dropbox.com/s/j260ve4f90h1p41/one-page.docx?dl=1"; | |
$fileName="one-page-url.docx"; | |
$folder=null; | |
$request = new Requests\ImageGetDocumentInfoFromUrlRequest($url); | |
$request->fileName =$fileName; | |
$request->folder = $folder; | |
$response = $viewerApi->imageGetDocumentInfoFromUrl($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "File Extension: ", $response->getExtension(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$documentInfoOptions = new \GroupDocs\Viewer\Model\DocumentInfoOptions(); | |
$documentInfoOptions->setPassword("password"); | |
$fileName="password-protected.docx"; | |
$folder="words"; | |
$request = new Requests\HtmlGetDocumentInfoWithOptionsRequest($fileName); | |
$request->folder = $folder; | |
$request->documentInfoOptions = $documentInfoOptions; | |
$response = $viewerApi->htmlGetDocumentInfoWithOptions($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "File Extension: ", $response->getExtension(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$documentInfoOptions = new \GroupDocs\Viewer\Model\DocumentInfoOptions(); | |
$documentInfoOptions->setPassword("password"); | |
$fileName="password-protected.docx"; | |
$folder="words"; | |
$request = new Requests\ImageGetDocumentInfoWithOptionsRequest($fileName); | |
$request->folder = $folder; | |
$request->documentInfoOptions = $documentInfoOptions; | |
$response = $viewerApi->imageGetDocumentInfoWithOptions($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "File Extension: ", $response->getExtension(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$documentInfoOptions = new \GroupDocs\Viewer\Model\DocumentInfoOptions(); | |
$documentInfoOptions->slidesOptions = new \GroupDocs\Viewer\Model\SlidesOptions(); | |
$documentInfoOptions->slidesOptions->setRenderNotes(true); | |
$url="https://www.dropbox.com/s/r2eioe2atushqcf/with-notes.pptx?dl=1"; | |
$fileName="with-notes-url.pptx"; | |
$folder="slides/pptx"; | |
$request = new Requests\HtmlGetDocumentInfoFromUrlWithOptionsRequest($url); | |
$request->fileName =$fileName; | |
$request->folder = $folder; | |
$request->documentInfoOptions = $documentInfoOptions; | |
$response = $viewerApi->htmlGetDocumentInfoFromUrlWithOptions($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "File Extension: ", $response->getExtension(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$documentInfoOptions = new \GroupDocs\Viewer\Model\DocumentInfoOptions(); | |
$documentInfoOptions->slidesOptions = new \GroupDocs\Viewer\Model\SlidesOptions(); | |
$documentInfoOptions->slidesOptions->setRenderNotes(true); | |
$url="https://www.dropbox.com/s/r2eioe2atushqcf/with-notes.pptx?dl=1"; | |
$fileName="with-notes-url.pptx"; | |
$folder="slides/pptx"; | |
$request = new Requests\ImageGetDocumentInfoFromUrlWithOptionsRequest($url); | |
$request->fileName =$fileName; | |
$request->folder = $folder; | |
$request->documentInfoOptions = $documentInfoOptions; | |
$response = $viewerApi->imageGetDocumentInfoFromUrlWithOptions($request); | |
echo "Attachment Count: ", count($response->getPages()); | |
echo "<br>"; | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "File Extension: ", $response->getExtension(); | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$request = new Requests\GetFontsRequest(); | |
$response = $viewerApi->getFonts($request); | |
$families = $response->getFamilies(); | |
foreach ($families as $key => $family) { | |
echo $family->getName(); | |
echo "<br>"; | |
} | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid($sid); | |
$configuration->setAppKey($key); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try { | |
$fileName="one-page.docx"; | |
$folder=null; | |
$getPagesRequest = new Requests\HtmlGetPagesRequest($fileName); | |
$getPagesRequest->embedResources = false; | |
$getPagesRequest->folder = $folder; | |
$getPagesRequest->startPageNumber = 1; | |
$getPagesRequest->countPages = 1; | |
$pagesCollection = $viewerApi->htmlGetPages($getPagesRequest); | |
$page = $pagesCollection->getPages()[0]; | |
foreach ($page->getResources() as $key => $resource) { | |
$getResourceRequest = new Requests\HtmlGetPageResourceRequest( | |
$fileName = $fileName, | |
$pageNumber = $page->getNumber(), | |
$resourceName = $resource->getName(), | |
$folder = null, | |
$storage = null | |
); | |
$getResourceResponse = $viewerApi->htmlGetPageResource($getResourceRequest); | |
} | |
echo "<br>"; | |
echo "Document Page Resources Processed"; | |
} catch (Exception $e) { | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\HtmlGetPagesRequest($fileName); | |
$request->folder = $folderName; | |
$response = $viewerApi->htmlGetPages($request); | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "Page Count: ", count($response->getPages()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\ImageGetPagesRequest($fileName); | |
$request->folder = $folderName; | |
$response = $viewerApi->imageGetPages($request); | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "Page Count: ", count($response->getPages()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileUrl = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx"; | |
$folderName = null; | |
$request = new Requests\HtmlGetPagesFromUrlRequest($fileUrl); | |
$request->folder = $folderName; | |
$response = $viewerApi->htmlGetPagesFromUrl($request); | |
echo "Expected response type is HtmlPageCollection where PageCount is : ", count($response->getPages()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileUrl = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx"; | |
$folderName = null; | |
$format = "jpg"; | |
$request = new Requests\ImageGetPagesFromUrlRequest($fileUrl); | |
$request->folder = $folderName; | |
$request->format = $format; | |
$response = $viewerApi->imageGetPagesFromUrl($request); | |
echo "Expected response type is ImagePageCollection where PageCount is : ", count($response->getPages()); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileUrl = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\HtmlGetPdfFileFromUrlRequest($fileUrl); | |
$request->folder = $folderName; | |
$response = $viewerApi->htmlGetPdfFileFromUrl($request); | |
echo "Document Processed."; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileUrl = "https://www.dropbox.com/s/umokluz338w4ng7%2fone-page.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\ImageGetPdfFileFromUrlRequest($fileUrl); | |
$request->folder = $folderName; | |
$response = $viewerApi->imageGetPdfFileFromUrl($request); | |
echo "Document Processed."; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "one-page.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\HtmlGetPdfFileRequest($fileName); | |
$request->folder = $folderName; | |
$response = $viewerApi->htmlGetPdfFile($request); | |
echo "Document Processed."; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "one-page.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\ImageGetPdfFileRequest($fileName); | |
$request->folder = $folderName; | |
$response = $viewerApi->imageGetPdfFile($request); | |
echo "Document Processed."; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-XX"); | |
$configuration->setAppKey("XXXX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "one-page.docx"; | |
$pageNumber = 1; | |
$request = new Requests\HtmlGetPageRequest($fileName, $pageNumber); | |
$request->enableResponsiveRendering = true; | |
$request->embedResources = true; | |
$page = $viewerApi->htmlGetPage($request); | |
echo "Page HTML: ", $page; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample-one-page.docx"; | |
$folderName = "viewerdocs"; | |
$pdfFileOptions = new \GroupDocs\Viewer\Model\PdfFileOptions(); | |
$watermark = new \GroupDocs\Viewer\Model\Watermark(); | |
$watermark->setText("GroupDocs"); | |
$pdfFileOptions->Watermark = $watermark; | |
$request = new Requests\HtmlCreatePdfFileRequest( | |
$fileName, | |
$pdfFileOptions | |
); | |
$request->folder = $folderName; | |
$response = $viewerApi->htmlCreatePdfFile($request); | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "PDF File Name: ", $response->getPdfFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample-one-page.docx"; | |
$folderName = "viewerdocs"; | |
$pdfFileOptions = new \GroupDocs\Viewer\Model\PdfFileOptions(); | |
$watermark = new \GroupDocs\Viewer\Model\Watermark(); | |
$watermark->setText("GroupDocs"); | |
$pdfFileOptions->Watermark = $watermark; | |
$request = new Requests\ImageCreatePdfFileRequest( | |
$fileName, | |
$pdfFileOptions | |
); | |
$request->folder = $folderName; | |
$response = $viewerApi->imageCreatePdfFile($request); | |
echo "File Name: ", $response->getFileName(); | |
echo "<br>"; | |
echo "PDF File Name: ", $response->getPdfFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample-one-page.docx"; | |
$folderName = "viewerdocs"; | |
$resourcesPath = "./r/{resource-name}"; | |
$request = new Requests\HtmlGetZipWithPagesRequest($fileName); | |
$request->resourcePath = $resourcesPath; | |
$request->folder = $folderName; | |
$response = $viewerApi->htmlGetZipWithPages($request); | |
echo "Document Processed.", ""; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample-one-page.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\ImageGetZipWithPagesRequest($fileName); | |
$request->folder = $folderName; | |
$response = $viewerApi->imageGetZipWithPages($request); | |
echo "Document Processed.", ""; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\HtmlDeletePagesCacheRequest( | |
$fileName, | |
$folderName | |
); | |
$viewerApi->htmlDeletePagesCache($request); | |
echo "Document Cache Removed."; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.docx"; | |
$folderName = "viewerdocs"; | |
$request = new Requests\ImageDeletePagesCacheRequest( | |
$fileName, | |
$folderName | |
); | |
$viewerApi->imageDeletePagesCache($request); | |
echo "Document Cache Removed."; | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("xxx-xx"); | |
$configuration->setAppKey("xxxx"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "with-overflowed-text.xlsx"; | |
$cellsOptions = new \GroupDocs\Viewer\Model\CellsOptions(); | |
$cellsOptions->setRenderPrintAreaOnly(true); | |
$cellsOptions->setRenderGridLines(true); | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->cellsOptions = $cellsOptions; | |
$request = new Requests\HtmlCreatePagesCacheRequest($fileName); | |
$request->htmlOptions = $htmlOptions; | |
$response = $viewerApi->htmlCreatePagesCache($request); | |
echo "Pages Count: ", count($response->getPages()); | |
echo "FileName: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.docx"; | |
$folderName = "viewerdocs"; | |
$transformOptions = new \GroupDocs\Viewer\Model\ReorderOptions(); | |
$transformOptions->setPageNumber(1); | |
$transformOptions->setNewPosition(2); | |
$request = new Requests\HtmlTransformPagesRequest( | |
$fileName, | |
$transformOptions, | |
$folderName | |
); | |
$response = $viewerApi->htmlTransformPages($request); | |
echo "First Page Order: ", $response->getPages()[0]->getNumber(); | |
echo "<br>"; | |
echo "Second Page Order: ", $response->getPages()[1]->getNumber(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.docx"; | |
$folderName = "viewerdocs"; | |
$transformOptions = new \GroupDocs\Viewer\Model\ReorderOptions(); | |
$transformOptions->setPageNumber(1); | |
$transformOptions->setNewPosition(2); | |
$request = new Requests\ImageTransformPagesRequest( | |
$fileName, | |
$transformOptions, | |
$folderName | |
); | |
$response = $viewerApi->imageTransformPages($request); | |
echo "First Page Order: ", $response->getPages()[0]->getNumber(); | |
echo "<br>"; | |
echo "Second Page Order: ", $response->getPages()[1]->getNumber(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.docx"; | |
$folderName = "viewerdocs"; | |
$transformOptions = new \GroupDocs\Viewer\Model\RotateOptions(); | |
$transformOptions->setPageNumber(1); | |
$transformOptions->setAngle(90); | |
$request = new Requests\HtmlTransformPagesRequest( | |
$fileName, | |
$transformOptions, | |
$folderName | |
); | |
$response = $viewerApi->htmlTransformPages($request); | |
echo "First Page Angle: ", $response->getPages()[0]->getAngle(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use GroupDocs\Viewer\Model\Requests; | |
require_once('C:\xampp\htdocs\groupdocs-viewer-cloud-php-master\vendor\autoload.php'); | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("XXXX-X"); | |
$configuration->setAppKey("XXX-XX"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample.docx"; | |
$folderName = "viewerdocs"; | |
$transformOptions = new \GroupDocs\Viewer\Model\RotateOptions(); | |
$transformOptions->setPageNumber(1); | |
$transformOptions->setAngle(90); | |
$request = new Requests\ImageTransformPagesRequest( | |
$fileName, | |
$transformOptions, | |
$folderName | |
); | |
$response = $viewerApi->imageTransformPages($request); | |
echo "First Page Angle: ", $response->getPages()[0]->getAngle(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("xxx-xx"); | |
$configuration->setAppKey("xxxx"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "sample2.pdf"; | |
$PdfOptions = new \GroupDocs\Viewer\Model\PdfOptions(); | |
$PdfOptions->setImageQuality("High"); | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->PdfOptions = $PdfOptions; | |
$request = new Requests\HtmlCreatePagesCacheRequest($fileName); | |
$request->htmlOptions = $htmlOptions; | |
$response = $viewerApi->htmlCreatePagesCache($request); | |
echo "Pages Count: ", count($response->getPages()); | |
echo "FileName: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//TODO: Get your AppSID and AppKey at https://dashboard.groupdocs.cloud (free registration is required). | |
$configuration = new GroupDocs\Viewer\Configuration(); | |
$configuration->setAppSid("xxx-xx"); | |
$configuration->setAppKey("xxxx"); | |
$viewerApi = new GroupDocs\Viewer\ViewerApi($configuration); | |
try | |
{ | |
$fileName = "with-overflowed-text.xlsx"; | |
$cellsOptions = new \GroupDocs\Viewer\Model\CellsOptions(); | |
$cellsOptions->setTextOverflowMode ("AutoFitColumn"); | |
$htmlOptions = new \GroupDocs\Viewer\Model\HtmlOptions(); | |
$htmlOptions->cellsOptions = $cellsOptions; | |
$request = new Requests\HtmlCreatePagesCacheRequest($fileName); | |
$request->htmlOptions = $htmlOptions; | |
$response = $viewerApi->htmlCreatePagesCache($request); | |
echo "Pages Count: ", count($response->getPages()); | |
echo "FileName: ", $response->getFileName(); | |
} | |
catch (Exception $e) | |
{ | |
echo "Something went wrong: ", $e->getMessage(), "\n"; | |
PHP_EOL; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment