Last active
July 28, 2017 12:43
-
-
Save aspose-words/f4e1cccc9434a69a6e5347482a8aa03c to your computer and use it in GitHub Desktop.
The GIST contains PHP code snippets for examples of Aspose.Words for Cloud.
This file contains hidden or 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
Aspose.Words-for-Cloud-for-PHP |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Bookmarks { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentBookmarkByName() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentBookmarkByName($fileName, $bookmarkName="aspose", $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$bookmarks = new Bookmarks(); | |
$bookmarks->getDocumentBookmarkByName(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Bookmarks { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentBookmarks() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentBookmarks($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$bookmarks = new Bookmarks(); | |
$bookmarks->getDocumentBookmarks(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Bookmarks { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postUpdateDocumentBookmark() { | |
$body = array("Name" => "aspose", "Text" => "Aspose APIs"); | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->PostUpdateDocumentBookmark($fileName, $bookmarkName="aspose", $filename = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
} | |
$bookmarks = new Bookmarks(); | |
$bookmarks->postUpdateDocumentBookmark(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class DocumentProperties { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteDocumentProperty() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->DeleteDocumentProperty($fileName, $propertyName="AsposeAuthor", $filename = null, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$documentProperties = new DocumentProperties(); | |
$documentProperties->deleteDocumentProperty(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class DocumentProperties { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentProperties() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentProperties($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$documentProperties = new DocumentProperties(); | |
$documentProperties->getDocumentProperties(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class DocumentProperties { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentProperty() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentProperty($fileName, $propertyName="Author", $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$documentProperties = new DocumentProperties(); | |
$documentProperties->getDocumentProperty(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class DocumentProperties { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function putUpdateDocumentProperty() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$body = array('Name' => 'Provider', 'Value' => 'Jobs'); | |
$result = $this->wordsApi->PutUpdateDocumentProperty($fileName, $propertyName="Provider", $filename = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
} | |
$documentProperties = new DocumentProperties(); | |
$documentProperties->putUpdateDocumentProperty(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function acceptAllRevisions() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->AcceptAllRevisions($fileName, $filename = null, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$document = new Document(); | |
$document->acceptAllRevisions(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteDocumentMacros() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "Test.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->DeleteDocumentMacros($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$document = new Document(); | |
$document->deleteDocumentMacros(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocument() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "Test.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocument($fileName, $storage = null, $folder = null); | |
$this->assertInternalType('string', $result); | |
} | |
} | |
$document = new Document(); | |
$document->getDocument(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentStatistics() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentStatistics($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$document = new Document(); | |
$document->getDocumentStatistics(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentWithFormat() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "Test.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentWithFormat($fileName, $format="pdf", $storage = null, $folder = null, $outPath = null); | |
$fh = fopen(realpath(__DIR__ . '/../../..'). '/Data/Output/Test.pdf', 'w'); | |
fwrite($fh, $result); | |
fclose($fh); | |
} | |
} | |
$document = new Document(); | |
$document->getDocumentWithFormat(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postAppendDocument() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$appendDocs = array("SampleAppendDoc.docx", "SampleAppendDoc2.docx"); | |
$importFormatsModes = array("KeepSourceFormatting", "UseDestinationStyles"); | |
$body = '{ "DocumentEntries": ['; | |
for ($i = 0; $i < count($appendDocs); $i++) { | |
$body .= '{ "Href": "' . $appendDocs[$i] . | |
'", "ImportFormatMode": "' . $importFormatsModes[$i] . '" }' . | |
(($i < (count($appendDocs) - 1)) ? ',' : ''); | |
} | |
$body .= ' ] }'; | |
$result = $this->words->PostAppendDocument($fileName, $filename = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
} | |
$document = new Document(); | |
$document->postAppendDocument(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postDocumentSaveAs() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$body = '{ | |
"SaveFormat": "pdf", | |
"FileName": "SampleWordDocument.pdf" | |
}'; | |
$response = $this->wordsApi->PostDocumentSaveAs($fileName, $storage = null, $folder = null, $body); | |
$result = json_decode($response); | |
print_r($result); | |
} | |
} | |
$document = new Document(); | |
$document->postDocumentSaveAs(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postLoadWebDocument() { | |
$xml = <<<XML | |
<LoadWebDocumentData> | |
<LoadingDocumentUrl>http://google.com</LoadingDocumentUrl> | |
<DocSaveOptionsData> | |
<SaveFormat>doc</SaveFormat> | |
<FileName>google.doc</FileName> | |
</DocSaveOptionsData> | |
</LoadWebDocumentData> | |
XML; | |
$strXML = simplexml_load_string($xml); | |
$result = $this->wordsApi->PostLoadWebDocument($strXML->asXML()); | |
print_r($result); | |
} | |
} | |
$document = new Document(); | |
$document->postLoadWebDocument(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postRunTask() { | |
$result = $this->wordsApi->PostRunTask(); | |
print_r($result); | |
} | |
} | |
$document = new Document(); | |
$document->postRunTask(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function putConvertDocument() { | |
$file = realpath(__DIR__ . '/../../..') . '/Data/SampleWordDocument.docx'; | |
$result = $this->wordsApi->PutConvertDocument($format = "pdf", $outPath = null, $file); | |
$fh = fopen(realpath(__DIR__ . '/../../..'). '/Data/Output/FormFilled.pdf', 'w'); | |
fwrite($fh, $result); | |
fclose($fh); | |
} | |
} | |
$document = new Document(); | |
$document->putConvertDocument(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function putDocumentSaveAsTiff() { | |
$body = '{ | |
"TiffCompression": "Ccitt4", | |
"PageCount": 1, | |
"PixelFormat": "Format16BppRgb555", | |
"PaperColor": "Red", | |
"Resolution": 200, | |
"Scale": 1.5, | |
"ImageBrightness": 0.5, | |
"ImageColorMode": "None", | |
"ImageContrast": 0.9, | |
"UseHighQualityRendering": true, | |
"UseAntiAliasing": true, | |
"PageIndex": 0, | |
"NumeralFormat": "EasternArabicIndic", | |
"SaveFormat": "tiff", | |
"FileName": "MyDocument1.tiff" | |
}'; | |
$result = $this->wordsApi->PutDocumentSaveAsTiff($name="Test.docx", $resultFile = null, $useAntiAliasing = null, $useHighQualityRendering = null, $imageBrightness = null, $imageColorMode = null, $imageContrast = null, $numeralFormat = null, $pageCount = null, $pageIndex = null, $paperColor = null, $pixelFormat = null, $resolution = null, $scale = null, $tiffCompression = null, $dmlRenderingMode = null, $dmlEffectsRenderingMode = null, $tiffBinarizationMethod = null, $storage = null, $folder = null, $zipOutput = null, $body); | |
print_r($result); | |
} | |
} | |
$document = new Document(); | |
$document->putDocumentSaveAsTiff(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function rejectAllRevisions() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->RejectAllRevisions($name=$fileName, $filename = null, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$document = new Document(); | |
$document->rejectAllRevisions(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Document { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function renderPage() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "SampleWordDocument.docx"; | |
Utils::uploadFile($name); | |
$page_index = 1; | |
$format = "bmp"; | |
$result = $this->wordsApi->renderPage($name, $page_index, $format, $storage=null, $folder=null); | |
} | |
} | |
$document = new Document(); | |
$document->renderPage(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class DrawingObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentDrawingObjectByIndex() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "OLE.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentDrawingObjectByIndex($fileName, $objectIndex=0, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$drawingObjects = new DrawingObjects(); | |
$drawingObjects->getDocumentDrawingObjectByIndex(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class DrawingObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentDrawingObjectByIndexWithFormat() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "OLE.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentDrawingObjectByIndexWithFormat($fileName, $objectIndex=0, $format="png", $storage = null, $folder = null); | |
$fh = fopen(realpath(__DIR__ . '/../../..') . '/Data/Output/OLE.png', 'w'); | |
fwrite($fh, $result); | |
fclose($fh); | |
} | |
} | |
$drawingObjects = new DrawingObjects(); | |
$drawingObjects->getDocumentDrawingObjectByIndexWithFormat(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class DrawingObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentDrawingObjectImageData() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentDrawingObjectImageData($fileName, $objectIndex=2, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$drawingObjects = new DrawingObjects(); | |
$drawingObjects->getDocumentDrawingObjectImageData(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class DrawingObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentDrawingObjectOleData() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "Sample_EmbeddedOLE.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentDrawingObjectOleData($fileName, $objectIndex=0, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$drawingObjects = new DrawingObjects(); | |
$drawingObjects->getDocumentDrawingObjectOleData(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class DrawingObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentDrawingObjects() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentDrawingObjects($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$drawingObjects = new DrawingObjects(); | |
$drawingObjects->getDocumentDrawingObjects(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteDocumentFields() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "Test.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->DeleteDocumentFields($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$fields = new Fields(); | |
$fields->deleteDocumentFields(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteFormField() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "FormFilled.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->DeleteFormField($fileName, $sectionIndex="0", $paragraphIndex="0", $formfieldIndex="0", $destFileName = null, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$fields = new Fields(); | |
$fields->deleteFormField(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteSectionFields() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "Test.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->DeleteSectionFields($fileName, $sectionIndex="0", $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$fields = new Fields(); | |
$fields->deleteSectionFields(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteSectionParagraphFields() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "Test.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->DeleteSectionParagraphFields($fileName, $sectionIndex="0", $paragraphIndex="0", $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$fields = new Fields(); | |
$fields->deleteSectionParagraphFields(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentFieldNames() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleMailMergeTemplate.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentFieldNames($fileName, $useNonMergeFields = false, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$fields = new Fields(); | |
$fields->getDocumentFieldNames(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getFormField() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "FormFilled.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetFormField($fileName, $sectionIndex="0", $paragraphIndex="0", $formfieldIndex="0", $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$fields = new Fields(); | |
$fields->getFormField(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postFormField() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "FormFilled.docx"; | |
Utils::uploadFile($fileName); | |
$body = '{ | |
"NodeId": "0.0.0", | |
"Name": "BirthDate", | |
"Enabled": true, | |
"StatusText": "Enter your date of birth.", | |
"OwnStatus": true, | |
"HelpText": "Enter your date of birth.", | |
"OwnHelp": true, | |
"CalculateOnExit": false, | |
"EntryMacro": "", | |
"ExitMacro": "", | |
"TextInputFormat": "yyyy-MM-dd", | |
"TextInputType": "Date", | |
"TextInputDefault": "", | |
"MaxLength": 0, | |
"link": { | |
"Href": "FormFilled.docx/sections/0/paragraphs/0/formfields/0", | |
"Rel": "self", | |
"Type": null, | |
"Title": null | |
} | |
}'; | |
$result = $this->words->PostFormField($name="FormFilled.docx", $sectionIndex="0", $paragraphIndex="0", $formfieldIndex="0", $destFileName = null, $storage = null, $folder = null, $body); | |
$this->assertEquals(200, $result->Code); | |
} | |
} | |
$fields = new Fields(); | |
$fields->postFormField(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postInsertPageNumbers() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$alignment = "center"; | |
$format = "{PAGE} of {NUMPAGES}"; | |
$isTop = true; | |
$setPageNumberOnFirstPage = true; | |
$body = array('Format'=>$format, 'Alignment'=>$alignment, | |
'IsTop'=>$isTop, 'SetPageNumberOnFirstPage'=>$setPageNumberOnFirstPage); | |
$result = $this->words->PostInsertPageNumbers($fileName, $filename = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
} | |
$fields = new Fields(); | |
$fields->postInsertPageNumbers(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postUpdateDocumentFields() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->PostUpdateDocumentFields($fileName, $filename = null, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$fields = new Fields(); | |
$fields->postUpdateDocumentFields(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Fields { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function putFormField() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "FormFilled.docx"; | |
Utils::uploadFile($fileName); | |
$body = '{ | |
"Name": "FullName", | |
"Enabled": true, | |
"StatusText": "Enter your name and surname (trimmed to 30 characters)" | |
}'; | |
$result = $this->words->PutFormField($fileName, $sectionIndex=0, $paragraphIndex=0, $insertBeforeNode = null, $destFileName = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
} | |
$fields = new Fields(); | |
$fields->putFormField(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Hyperlinks { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentHyperlinkByIndex() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentHyperlinkByIndex($fileName, $hyperlinkIndex=0, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$hyperlinks = new Hyperlinks(); | |
$hyperlinks->getDocumentHyperlinkByIndex(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Hyperlinks { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentHyperlinks() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentHyperlinks($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$hyperlinks = new Hyperlinks(); | |
$hyperlinks->getDocumentHyperlinks(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class MailMerge { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function populateDocumentTemplateWithData() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleExecuteTemplate.doc"; | |
Utils::uploadFile($fileName); | |
$file = realpath(__DIR__ . '/../../..') . '/Data/SampleExecuteTemplateData.txt'; | |
$result = $this->wordsApi->PostExecuteTemplate($fileName, $cleanup = null, $filename = null, $storage = null, $folder = null, $useWholeParagraphAsRegion = null, $withRegions = null, $file); | |
print_r($result); | |
} | |
} | |
$mailMerge = new MailMerge(); | |
$mailMerge->populateDocumentTemplateWithData(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class MailMerge { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postDocumentExecuteMailMerge() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleMailMergeTemplateImage.doc"; | |
Utils::uploadFile($fileName); | |
$file = realpath(__DIR__ . '/../../..') . '/Data/SampleMailMergeTemplateImageData.txt'; | |
$result = $this->wordsApi->PostDocumentExecuteMailMerge($fileName, $withRegions=false, $mailMergeDataFile = null, $cleanup = null, $filename = null, $storage = null, $folder = null, $useWholeParagraphAsRegion = null, $file); | |
print_r($result); | |
} | |
} | |
$mailMerge = new MailMerge(); | |
$mailMerge->postDocumentExecuteMailMerge(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class MailMerge { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function putExecuteMailMergeOnline() { | |
$data['file2'] = new CurlFile(realpath(__DIR__ . '/../../..') . '/Data/SampleMailMergeTemplate.docx', 'application/msword'); | |
$data['file1'] = new CurlFile(realpath(__DIR__ . '/../../..') . '/Data/SampleMailMergeTemplateData.xml', 'text/xml'); | |
$result = $this->wordsApi->PutExecuteMailMergeOnline($withRegions='false', $cleanup = null, $data); | |
print_r($result); | |
} | |
} | |
$mailMerge = new MailMerge(); | |
$mailMerge->putExecuteMailMergeOnline(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class MailMerge { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function putExecuteTemplateOnline() { | |
$file = realpath(__DIR__ . '/../..') . '/Data/SampleMailMergeTemplateData.xml'; | |
$result = $this->wordsApi->PutExecuteTemplateOnline($cleanup = null, $useWholeParagraphAsRegion = null, $withRegions = null, $file); | |
print_r($result); | |
} | |
} | |
$mailMerge = new MailMerge(); | |
$mailMerge->putExecuteTemplateOnline(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class MathObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteOfficeMathObject() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "MathsObject.docx"; | |
Utils::uploadFile($name); | |
$index = 1; | |
$result = $this->wordsApi->deleteOfficeMathObject($name, $index, $storage=null, $folder=null); | |
print_r($result); | |
} | |
} | |
$mathObjects = new MathObjects(); | |
$mathObjects->deleteOfficeMathObject(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class MathObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getOfficeMathObject() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "MathsObject.docx"; | |
Utils::uploadFile($name); | |
$index = 1; | |
$result = $this->wordsApi->getOfficeMathObject($name, $index, $storage=null, $folder=null); | |
print_r($result); | |
} | |
} | |
$mathObjects = new MathObjects(); | |
$mathObjects->getOfficeMathObject(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class MathObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getOfficeMathObjects() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "MathsObject.docx"; | |
Utils::uploadFile($name); | |
$result = $this->wordsApi->getOfficeMathObjects($name, $storage=null, $folder=null); | |
print_r($result); | |
} | |
} | |
$mathObjects = new MathObjects(); | |
$mathObjects->getOfficeMathObjects(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class MathObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getOfficeMathObjectsForAParticularParagraph() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "MathsObject.docx"; | |
Utils::uploadFile($name); | |
$paragraph_index = 1; | |
$result = $this->wordsApi->getOfficeMathObjectsForAParticularParagraph($name, $paragraph_index, $storage=null, $folder=null); | |
print_r($result); | |
} | |
} | |
$mathObjects = new MathObjects(); | |
$mathObjects->getOfficeMathObjectsForAParticularParagraph(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class MathObjects { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getOfficeMathObjectsForAParticularSection() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "MathsObject.docx"; | |
Utils::uploadFile($name); | |
$section_index = 0; | |
$paragraph_index = 1; | |
$result = $this->wordsApi->getOfficeMathObjectsForAParticularSection($name, $section_index, $paragraph_index, $storage=null, $folder=null); | |
print_r($result); | |
} | |
} | |
$mathObjects = new MathObjects(); | |
$mathObjects->getOfficeMathObjectsForAParticularSection(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Paragraphs { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteParagraphFields() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "Test.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->DeleteParagraphFields($fileName, $index=1, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$paragraphs = new Paragraphs(); | |
$paragraphs->deleteParagraphFields(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Paragraphs { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentParagraph() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentParagraph($fileName, $index=1, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$paragraphs = new Paragraphs(); | |
$paragraphs->getDocumentParagraph(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Paragraphs { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentParagraphRun() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentParagraphRun($fileName, $index="0", $runIndex="0", $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$paragraphs = new Paragraphs(); | |
$paragraphs->getDocumentParagraphRun(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Paragraphs { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentParagraphRunFont() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentParagraphRunFont($fileName, $index=0, $runIndex=0, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$paragraphs = new Paragraphs(); | |
$paragraphs->getDocumentParagraphRunFont(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Paragraphs { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentParagraphs() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentParagraphs($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$paragraphs = new Paragraphs(); | |
$paragraphs->getDocumentParagraphs(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Paragraphs { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postDocumentParagraphRunFont() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$body = '{ | |
"Font:" { | |
"Name": "Arial", | |
"Bold": true | |
} | |
}'; | |
$result = $this->words->PostDocumentParagraphRunFont($fileName, $index=0, $runIndex=0, $storage = null, $folder = null, $filename = null, $body); | |
print_r($result); | |
} | |
} | |
$paragraphs = new Paragraphs(); | |
$paragraphs->postDocumentParagraphRunFont(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Protection { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteUnprotectDocument() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$body = array("Password"=>"123456"); | |
$result = $this->wordsApi->DeleteUnprotectDocument($fileName, $filename = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
} | |
$protection = new Protection(); | |
$protection->deleteUnprotectDocument(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Protection { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentProtection() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentProtection($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$protection = new Protection(); | |
$protection->getDocumentProtection(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Protection { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postChangeDocumentProtection() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$body = array("Password" => "123456", "NewPassword" => "123456789"); | |
$result = $this->wordsApi->PostChangeDocumentProtection($fileName, $filename = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
} | |
$protection = new Protection(); | |
$protection->postChangeDocumentProtection(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Protection { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function putProtectDocument() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$password = "123456"; | |
$protectionType = "AllowOnlyComments"; | |
$body = array('Password' => $password, 'ProtectionType' => $protectionType); | |
$result = $this->wordsApi->PutProtectDocument($fileName, $filename = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
$protection = new Protection(); | |
$protection->putProtectDocument(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Sections { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getSection() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetSection($fileName, $sectionIndex=0, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$sections = new Sections(); | |
$sections->getSection(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Sections { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getSectionPageSetup() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetSectionPageSetup($fileName, $sectionIndex=0, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$sections = new Sections(); | |
$sections->getSectionPageSetup(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Sections { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getSections() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetSections($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$sections = new Sections(); | |
$sections->getSections(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Sections { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function updateSectionPageSetup() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$body = '{ | |
"PageSetup": { | |
"LeftMargin":10.0, | |
"Orientation": "Landscape", | |
"PaperSize": "A5" | |
} | |
}'; | |
$result = $this->words->UpdateSectionPageSetup($fileName, $sectionIndex=0, $storage = null, $folder = null, $filename = null, $body); | |
print_r($result); | |
} | |
} | |
$sections = new Sections(); | |
$sections->updateSectionPageSetup(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class SplitResource { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postSplitDocument() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->PostSplitDocument($fileName, $format = "pdf", $from = null, $to = null, $zipOutput = true, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$splitResource = new SplitResource(); | |
$splitResource->postSplitDocument(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class SplitResource { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postSplitDocument() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->PostSplitDocument($fileName, $format = "text", $from = 1, $to = 2, $zipOutput = false, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$splitResource = new SplitResource(); | |
$splitResource->postSplitDocument(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class SplitResource { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postSplitDocument() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->PostSplitDocument($fileName, $format = "pdf", $from = 1, $to = 2, $zipOutput = false, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$splitResource = new SplitResource(); | |
$splitResource->postSplitDocument(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Tables { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteBorders() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "TableDocument.doc"; | |
Utils::uploadFile($name); | |
$table_index = 1; | |
$row_index = 0; | |
$result = $this->wordsApi->deleteBorders($name, $table_index, $row_index, $storage=null, $folder=null); | |
print_r($result); | |
} | |
} | |
$tables = new Tables(); | |
$tables->deleteBorders(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Tables { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteTable() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "TableDocument.doc"; | |
Utils::uploadFile($name); | |
$index = 1; | |
$result = $this->wordsApi->deleteTable($name, $index, $storage=null, $folder=null); | |
print_r($result); | |
} | |
} | |
$tables = new Tables(); | |
$tables->deleteTable(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Tables { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getBorders() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "TableDocument.doc"; | |
Utils::uploadFile($name); | |
$table_index = 1; | |
$row_index = 0; | |
$result = $this->wordsApi->getBorders($name, $table_index, $row_index, $storage=null, $folder=null); | |
print_r($result); | |
} | |
} | |
$tables = new Tables(); | |
$tables->getBorders(); | |
?> |
This file contains hidden or 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
// For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Tables { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getTable() | |
{ | |
// Upload file to Aspose Cloud Storage | |
$name = "TableDocument.doc"; | |
Utils::uploadFile($name); | |
$index = 1; | |
$result = $this->wordsApi->getTable($name, $index, $storage=null, $folder=null); | |
print_r($result); | |
} | |
} | |
$tables = new Tables(); | |
$tables->getTable(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Text { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function getDocumentTextItems() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->GetDocumentTextItems($fileName, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$text = new Text(); | |
$text->getDocumentTextItems(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Text { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postReplaceText() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$oldValue = "Times New Roman"; | |
$newValue = "Arial Black"; | |
$isMatchCase = false; | |
$isMatchWholeWord = true; | |
$body = array('OldValue'=>$oldValue, 'NewValue'=>$newValue, | |
'IsMatchCase'=>$isMatchCase, 'IsMatchWholeWord'=>$isMatchWholeWord); | |
$result = $this->wordsApi->PostReplaceText($fileName, $filename = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
} | |
$text = new Text(); | |
$text->postReplaceText(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once __DIR__ . '/vendor/autoload.php'; | |
use Aspose\Storage\StorageApi; | |
use Aspose\Storage\AsposeApp; | |
class Utils { | |
# Get App key and App SID from https://cloud.aspose.com | |
const appSID = "App SID"; | |
const apiKey = "App Key"; | |
public static function uploadFile($fileName) { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$storage = new StorageApi(); | |
$file = realpath(__DIR__ . '/../..') . '/Data/' . $fileName; | |
$result = $storage->PutCreate($Path=$fileName, $versionId = null, $storage = null, $file); | |
} | |
} | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Watermark { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function deleteDocumentWatermark() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleBlankWatermarkDocument.docx"; | |
Utils::uploadFile($fileName); | |
$result = $this->wordsApi->DeleteDocumentWatermark($fileName, $filename = null, $storage = null, $folder = null); | |
print_r($result); | |
} | |
} | |
$watermark = new Watermark(); | |
$watermark->deleteDocumentWatermark(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Watermark { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postInsertDocumentWatermarkImage() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$file = realpath(__DIR__ . '/../../..') . '/Data/aspose-cloud.png'; | |
$result = $this->words->PostInsertDocumentWatermarkImage($fileName, $filename = null, $rotationAngle = null, $image = null, $storage = null, $folder = null, $file); | |
$this->assertEquals(200, $result->Code); | |
} | |
} | |
$watermark = new Watermark(); | |
$watermark->postInsertDocumentWatermarkImage(); | |
?> |
This file contains hidden or 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
# For complete examples and data files, please go to https://github.com/aspose-words/Aspose.Words-for-Cloud | |
<?php | |
require_once realpath(__DIR__ . '/..') . '/vendor/autoload.php'; | |
require_once realpath(__DIR__ . '/..') . '/Utils.php'; | |
use Aspose\Words\WordsApi; | |
use Aspose\Words\AsposeApp; | |
class Watermark { | |
public $wordsApi; | |
public function __construct() { | |
AsposeApp::$appSID = Utils::appSID; | |
AsposeApp::$apiKey = Utils::apiKey; | |
$this->wordsApi = new WordsApi(); | |
} | |
public function postInsertDocumentWatermarkText() { | |
// Upload file to Aspose Cloud Storage | |
$fileName = "SampleWordDocument.docx"; | |
Utils::uploadFile($fileName); | |
$body = array('Text' => 'Welcome Aspose', 'RotationAngle' => 45.0); | |
$result = $this->wordsApi->PostInsertDocumentWatermarkText($fileName, $filename = null, $text = null, $rotationAngle = null, $storage = null, $folder = null, $body); | |
print_r($result); | |
} | |
} | |
$watermark = new Watermark(); | |
$watermark->postInsertDocumentWatermarkText(); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment