Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\SaveOptionsData;
use Aspose\Words\Model\DocumentEntryList;
use Aspose\Words\Model\DocumentEntry;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_doc.docx";
$documentToAppend = "test_multi_pages.docx";
$folder = ""; // File exists at the root of the storage
$destName = "Out_Merged.docx"; // // Changes will be made in the source document
// Upload original document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Upload the document to append to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $documentToAppend, "", CommonUtils::$MyStorage));
$documentList = new DocumentEntryList();
$docEntry = new DocumentEntry(array("href" => $documentToAppend, "import_format_mode" => "KeepSourceFormatting"));
$documentList->setDocumentEntries(array($docEntry));
// Create request and execute api method
$request = new Requests\AppendDocumentRequest($fileName, $documentList, $folder, CommonUtils::$MyStorage, null, null, $destName, null, null);
$result = $wordsApi->appendDocument($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\StyleApply;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TestApplyStyleToDocumentElement.docx";
$styledNodePath = "paragraphs/1/paragraphFormat";
$body = new StyleApply(array("style_name" => "Heading 1"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\ApplyStyleToDocumentElementRequest($fileName, $body, $styledNodePath, null, CommonUtils::$MyStorage);
$result = $wordsApi->applyStyleToDocumentElement($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
Aspose-Words-Cloud-SDK-PHP
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\ReportEngineSettings;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ReportTemplate.docx";
$data = file_get_contents(realpath(__DIR__ . '/../..') . '\resources\\ReportData.json');
$settings = new ReportEngineSettings(array("data_source_type" => "Json", "report_build_options" => ["AllowMissingMembers", "RemoveEmptyParagraphs"]));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\BuildReportRequest($fileName, $data, $settings, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->buildReport($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\ReportEngineSettings;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$file = realpath(__DIR__ . '/../..') . '/resources/ReportTemplate.docx';
$data = file_get_contents(realpath(__DIR__ . '/../..') . '/resources/ReportData.json');
$settings = new ReportEngineSettings(array("data_source_type" => "Json", "data_source_name" => "persons"));
// Create request and execute api method
$request = new Requests\BuildReportOnlineRequest($file, $data, $settings, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->buildReportOnline($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\ClassifyDocumentRequest($fileName, CommonUtils::$MyStorage, null, null, null, null);
$result = $wordsApi->classifyDocument($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\CompareData;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName1 = "compareTestDoc1.doc";
$fileName2 = "compareTestDoc2.doc";
$destName = "Out_ComparedTestDocs.doc";
$compareData = new CompareData(array("author" => "author", "comparing_with_document" => $fileName2, "date_time" => new \DateTime("now")));
// Upload original document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName1, "", CommonUtils::$MyStorage));
// Upload the document to compare to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName2, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\CompareDocumentRequest($fileName1, $compareData, null, CommonUtils::$MyStorage, null, null, $destName);
$result = $wordsApi->compareDocument($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.pdf";
$format = "docx";
$destName = "Out_test_multi_pages.docx";
$saveOptions = new SaveOptionsData(array("save_format" => $format, "file_name" => $destName));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\SaveAsRequest($fileName, $saveOptions, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->saveAs($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\SaveOptionsData;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$format = "pdf";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\ConvertDocumentRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, $format, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->convertDocument($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\SaveOptionsData;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$format = "html";
$destName = "Out_test_multi_pages.html";
$saveOptions = new SaveOptionsData(array("save_format" => $format, "file_name" => $destName));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\SaveAsRequest($fileName, $saveOptions, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->saveAs($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\TiffSaveOptionsData;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$format = "tiff";
$destName = "Out_test_multi_pages.tiff";
$saveOptions = new TiffSaveOptionsData(array("file_name" => $destName, "save_format" => $format));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\SaveAsTiffRequest($fileName, $saveOptions, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->saveAsTiff($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\StyleCopy;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TestCopyStyle.docx";
$body = new StyleCopy(array("style_name" => "Heading 1"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\CopyStyleRequest($fileName, $body, null, CommonUtils::$MyStorage);
$result = $wordsApi->copyStyle($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "NewDocument.docx";
$folder = null; // Document will be created at the root of the storage
// Create request and execute api method
$request = new Requests\CreateDocumentRequest(CommonUtils::$MyStorage, $fileName, $folder);
$result = $wordsApi->createDocument($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\DocumentPropertyCreateOrUpdate;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";$propertyName = "AsposeAuthor";
$property = new DocumentPropertyCreateOrUpdate(array("value" => "Imran Anwar"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\CreateOrUpdateDocumentPropertyRequest($fileName, $propertyName, $property, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->createOrUpdateDocumentProperty($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__, 2) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ParagraphTabStops.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteAllParagraphTabStopsRequest($fileName, "", $index, null, CommonUtils::$MyStorage);
$wordsApi->deleteAllParagraphTabStops($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "tables/1/rows/0/cells/0/";
$destName = "DeleteBorders.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteBordersRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null, $destName);
$result = $wordsApi->deleteBorders($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "tables/1/rows/0/cells/0/";
$destName = "DeleteBorders.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteBordersRequest($fileName, $sourcePath, null, CommonUtils::$MyStorage, null, null, $destName);
$result = $wordsApi->deleteBorders($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteCommentRequest($fileName, $index, null, CommonUtils::$MyStorage, null, null, null);
$wordsApi->deleteComment($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteMacrosRequest($fileName, null, CommonUtils::$MyStorage, null, null, null, null, null);
$result = $wordsApi->deleteMacros($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$propertyName = "testProp";
$destName = "Out_DeleteDocumentProperty.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteDocumentPropertyRequest($fileName, $propertyName, null, CommonUtils::$MyStorage, null, null, $destName, null, null);
$wordsApi->deleteDocumentProperty($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteDrawingObjectRequest($fileName, "sections/0", $index, null, CommonUtils::$MyStorage, null, null, null);
$wordsApi->deleteDrawingObject($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "GetField.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteFieldRequest($fileName, "sections/0", $index, null, CommonUtils::$MyStorage, null, null, null);
$wordsApi->deleteField($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "GetField.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteFieldsRequest($fileName, "sections/0", null, CommonUtils::$MyStorage, null, null, null);
$wordsApi->deleteFields($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "GetField.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteFootnoteRequest($fileName, "sections/0", $index, null, CommonUtils::$MyStorage, null, null, null);
$wordsApi->deleteFootnote($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "FormFilled.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteFormFieldRequest($fileName, "sections/0", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->deleteFormField($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "HeadersFooters.doc";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteHeaderFooterRequest($fileName, "", $index, null, CommonUtils::$MyStorage, null, null, null);
$wordsApi->deleteHeaderFooter($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "HeadersFooters.doc";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteHeaderFooterRequest($fileName, "", $index, null, CommonUtils::$MyStorage, null, null, null);
$wordsApi->deleteHeaderFooter($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__, 2) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ParagraphGetListFormat.doc";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteParagraphListFormatRequest($fileName, $index, null, CommonUtils::$MyStorage);
$wordsApi->deleteParagraphListFormat($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__, 2) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ParagraphTabStops.docx";
$position = 72;
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteParagraphTabStopRequest($fileName, $position, "", $index, null, CommonUtils::$MyStorage);
$wordsApi->deleteParagraphTabStop($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteTableRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null);
$wordsApi->deleteTable($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/tables/2/rows/0";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteTableCellRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null);
$wordsApi->deleteTableCell($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/tables/1";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\DeleteTableRowRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null);
$wordsApi->deleteTableRow($request);
echo("Deleted");
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "HeadersFooters.doc";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetHeaderFootersRequest($fileName, "", null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getHeaderFooters($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
// Create request and execute api method
$request = new Requests\GetAvailableFontsRequest();
$result = $wordsApi->getAvailableFonts($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/tables/2/rows/0";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetBorderRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getBorder($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/tables/2/rows/0";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetBordersRequest($fileName, $sourcePath, null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getBorders($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetCommentRequest($fileName, $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getComment($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetCommentsRequest($fileName, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getComments($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$bookmarkName = "aspose";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetBookmarkByNameRequest($fileName, $bookmarkName, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getBookmarkByName($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetBookmarksRequest($fileName, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getBookmarks($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetDocumentDrawingObjectByIndexRequest($fileName, "sections/0", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getDocumentDrawingObjectByIndex($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetDocumentDrawingObjectImageDataRequest($fileName, "{\"Left\": 0}", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getDocumentDrawingObjectImageData($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "sample_EmbeddedOLE.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetDocumentDrawingObjectOleDataRequest($fileName, "{\"Left\": 0}", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getDocumentDrawingObjectOleData($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetDocumentDrawingObjectsRequest($fileName, "sections/0", null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getDocumentDrawingObjects($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetDocumentFieldNamesRequest($fileName, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getDocumentFieldNames($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetDocumentRequest($fileName, null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getDocument($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetDocumentPropertiesRequest($fileName, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getDocumentProperties($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetDocumentPropertyRequest($fileName, $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getDocumentProperty($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetDocumentStatisticsRequest($fileName, null, CommonUtils::$MyStorage, null, null, null, null, null);
$result = $wordsApi->getDocumentStatistics($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "GetField.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetFieldRequest($fileName, "sections/0", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getField($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "GetField.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetFieldsRequest($fileName, "sections/0", null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getFields($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "Footnote.doc";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetFootnoteRequest($fileName, "", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getFootnote($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "Footnote.doc";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetFootnotesRequest($fileName, "", null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getFootnotes($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "FormFilled.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetFormFieldRequest($fileName, "sections/0", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getFormField($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "FormFilled.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetFormFieldsRequest($fileName, "sections/0", null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getFormFields($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "HeadersFooters.doc";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetHeaderFooterRequest($fileName, $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getHeaderFooter($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "HeadersFooters.doc";
$index = 0;
$sectionIndex = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetHeaderFooterOfSectionRequest($fileName, $index, $sectionIndex, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getHeaderFooterOfSection($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ListsGet.doc";
$listId = 1;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetListRequest($fileName, $listId, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getList($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ListsGet.doc";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetListsRequest($fileName, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->getLists($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__, 2) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ParagraphGetListFormat.doc";
$index = 1;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetParagraphListFormatRequest($fileName, "", $index, null, CommonUtils::$MyStorage);
$result = $wordsApi->getParagraphListFormat($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__, 2) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ParagraphGetListFormat.doc";
$index = 1;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetParagraphListFormatWithoutNodePathRequest($fileName, $index, null, CommonUtils::$MyStorage);
$result = $wordsApi->getParagraphListFormatWithoutNodePath($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__, 2) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ParagraphTabStops.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetParagraphTabStopsRequest($fileName, "", $index, null, CommonUtils::$MyStorage);
$result = $wordsApi->getParagraphTabStops($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TestGetStyleFromDocumentElement.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetStyleFromDocumentElementRequest($fileName, "paragraphs/1/paragraphFormat", null, CommonUtils::$MyStorage);
$result = $wordsApi->getStyleFromDocumentElement($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TestGetStyles.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetStylesRequest($fileName, null, CommonUtils::$MyStorage);
$result = $wordsApi->getStyles($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetTableRequest($fileName, "", $index, null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getTable($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/tables/2/rows/0";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetTableCellRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getTableCell($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/tables/2/rows/0";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetTableCellFormatRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getTableCellFormat($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/tables/1";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetTablePropertiesRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getTableProperties($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/tables/1";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetTableRowRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getTableRow($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/tables/1";
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetTableRowRequest($fileName, $sourcePath, $index, null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getTableRow($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\GetTablesRequest($fileName, "", null, CommonUtils::$MyStorage, null, null);
$result = $wordsApi->getTables($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TestMailMergeWithImages.doc";
$destName = "Out_TestMailMergeWithImages.docx";
$data = file_get_contents(realpath(__DIR__ . '/../..') . '\resources\MailMergeData.txt');
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\ExecuteMailMergeRequest($fileName, $data, null, CommonUtils::$MyStorage, null, null, null, null, null, false, $destName);
$result = $wordsApi->executeMailMerge($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\ListInsert;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TestInsertList.doc";
$body = new ListInsert(array("template" => "OutlineLegal"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\InsertListRequest($fileName, $body, null, CommonUtils::$MyStorage);
$result = $wordsApi->insertList($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__, 2) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\TabStopInsert;
use Aspose\Words\Model\TabStopBase;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "ParagraphTabStops.docx";
$index = 0;
$body = new TabStopInsert(array (
'alignment' => TabStopBase::ALIGNMENT_LEFT,
'leader' => TabStopBase::LEADER_NONE,
'position' => 72
));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\InsertOrUpdateParagraphTabStopRequest($fileName, $body, "", $index, null, CommonUtils::$MyStorage);
$result = $wordsApi->insertOrUpdateParagraphTabStop($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\StyleInsert;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TestInsertStyle.docx";
$body = new StyleInsert(array("style_name" => "My Style", "style_type" => "Paragraph"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\InsertStyleRequest($fileName, $body, null, CommonUtils::$MyStorage);
$result = $wordsApi->insertStyle($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\TableInsert;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0";
$body = new TableInsert(array("columns_count" => 3, "rows_count" => 5));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\InsertTableRequest($fileName, $body, $sourcePath, null, CommonUtils::$MyStorage, null, null, null, null, null);
$result = $wordsApi->insertTable($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\TableCellInsert;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$sourcePath = "sections/0/table/0";
$body = new TableCellInsert();
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\InsertTableCellRequest($fileName, $body, $sourcePath, null, CommonUtils::$MyStorage, null, null, null, null, null);
$result = $wordsApi->insertTableCell($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\TableRowInsert;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "TablesGet.docx";
$body = new TableRowInsert(array("columns_count" => 5));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\InsertTableRowRequest($fileName, $body, null, CommonUtils::$MyStorage, null, null, null, null, null);
$result = $wordsApi->insertTableRow($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "template.doc";
$destName = "Out_PostDocumentExecuteMailMergeWithHTMLData.docx";
$data = file_get_contents(realpath(__DIR__ . '/../..') . '\resources\TestPostDocumentExecuteMailMerge.txt');
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\ExecuteMailMergeRequest($fileName, $data, null, CommonUtils::$MyStorage, null, null, null, null, null, false, $destName);
$result = $wordsApi->executeMailMerge($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\NodeLink;
use Aspose\Words\Model\DocumentPosition;
use Aspose\Words\Model\CommentUpdate;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$index = 0;
$nodeLink = new NodeLink(array("node_id" => "0.3.0.3"));
$documentPosition = new DocumentPosition(array("node" => $nodeLink, "offset" => 0));
$body = new CommentUpdate(array("range_start" => $documentPosition,
"range_end" => $documentPosition,"initial" => "IA",
"author" => "Imran Anwar", "text" => "A new Comment"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\UpdateCommentRequest($fileName, $index, $body, null, CommonUtils::$MyStorage);
$result = $wordsApi->updateComment($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "SampleMailMergeTemplate.docx";
$destName = "Out_SampleMailMergeTemplate.docx";
$data = file_get_contents(realpath(__DIR__ . '/../..') . '\resources\SampleMailMergeTemplateData.txt');
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\ExecuteMailMergeRequest($fileName, $data, null, CommonUtils::$MyStorage, null, null, null, null, null, false, $destName);
$result = $wordsApi->executeMailMerge($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$image = realpath(__DIR__ . '/../..') . '/resources/aspose-cloud.png';
$index = 0;
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\UpdateDrawingObjectRequest($fileName, "{\"Left\": 0}", $image, "", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->updateDrawingObject($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\FieldUpdate;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "GetField.docx";
$index = 0;
$body = new FieldUpdate(array("field_code" => "{ NUMPAGES }"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\UpdateFieldRequest($fileName, $body, "sections/0/paragraphs/0", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->updateField($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\FootnoteUpdate;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "Footnote.doc";
$index = 0;
$footNote = new FootnoteUpdate(array("text" => "new text is here"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\UpdateFootnoteRequest($fileName, $footNote, "", $index, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->updateFootnote($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\FormFieldTextInput;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "FormFilled.docx";
$destName = "PostFormField.docx";
$index = 0;
$body = new FormFieldTextInput(array(
"name" => "FullName",
"enabled" => true,
"calculate_on_exit" => true,
"status_text" => "",
"text_input_type" => FormFieldTextInput::TEXT_INPUT_TYPE_REGULAR,
"text_input_default" => ""
));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\UpdateFormFieldRequest($fileName, $body, "sections/0/paragraphs/0", $index, null, CommonUtils::$MyStorage, null, null, $destName, null, null);
$result = $wordsApi->updateFormField($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\PageNumber;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$destName = "PostInsertPageNumbers.docx";
$body = new PageNumber(array("alignment" => "center", "format" => "{PAGE} of {NUMPAGES}"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\InsertPageNumbersRequest($fileName, $body, null, CommonUtils::$MyStorage, null, null, $destName, null, null);
$result = $wordsApi->insertPageNumbers($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\SaveOptionsData;
use Aspose\Words\Model\LoadWebDocumentData;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$saveOptions = new SaveOptionsData(array(
"file_name" => "google.doc",
"save_format" => "doc",
"dml_effects_rendering_mode" => "1",
"dml_rendering_mode" => "1",
"update_sdt_content" => false,
"zip_output" => false
));
$body = new LoadWebDocumentData(array("loading_document_url" => "http://google.com", "save_options" => $saveOptions));
$request = new Requests\LoadWebDocumentRequest($body);
$result = $wordsApi->loadWebDocument($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\BookmarkData;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$bookmarkName = "aspose";
$destName = "PostUpdateDocumentBookmark.docx";
$body = new BookmarkData(array("name" => $bookmarkName, "text" => "This will be the text for Aspose"));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\UpdateBookmarkRequest($fileName, $body, $bookmarkName, null, CommonUtils::$MyStorage, null, null, null, $destName);
$result = $wordsApi->updateBookmark($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "GetField.docx";
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\UpdateFieldsRequest($fileName, null, CommonUtils::$MyStorage, null, null, null);
$result = $wordsApi->updateFields($request);
print_r($result);
} catch (Exception $e) {
echo "Something went wrong: ", $e->getMessage(), "\n";
}
?>
<?php
include(dirname(__DIR__) . '\CommonUtils.php');
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests;
use Aspose\Words\Model\NodeLink;
use Aspose\Words\Model\DocumentPosition;
use Aspose\Words\Model\CommentInsert;
try {
// Create WordsApi instance
$wordsApi = new WordsApi(CommonUtils::$AppSid, CommonUtils::$AppKey, CommonUtils::$ApiBaseUrl);
$fileName = "test_multi_pages.docx";
$nodeLink = new NodeLink(array("node_id" => "0.3.0.3"));
$documentPosition = new DocumentPosition(array("node" => $nodeLink, "offset" => 0));
$body = new CommentInsert(array(
"range_start" => $documentPosition,
"range_end" => $documentPosition,
"initial" => "IA",
"author" => "Imran Anwar",
"text" => "A new comment"
));
// Upload document to Cloud Storage
$wordsApi->uploadFile(new Requests\UploadFileRequest(realpath(__DIR__ . '/../..') . '\resources\\' . $fileName, "", CommonUtils::$MyStorage));
// Create request and execute api method
$request = new Requests\InsertCommentRequest($fileName, $body, null, CommonUtils::$MyStorage);
$result = $wordsApi->insertComment($request);
print_r($result);