Aspose.Words  Cloud SDK for PHP

Work with Word Documents in the Cloud via PHP

Powerful PHP library for creating, editing and processing Word DOCX, DOC, RTF files

Get Started

Open, generate, edit, split, merge, compare and convert a Word document in PHP. It's easy for PHP developers to manipulate Microsoft Word documents. Convert PDF to Word (DOC, DOCX, ODT, RTF and HTML) and in the opposite direction with Aspose Cloud PHP library.

Advanced Word Document Processing Features

Merge multiple Word documents

Split all or specific pages of a Word document

Convert Word documents to different formats

Manipulate document properties

Execute simple to complex mail merge

Execute mail merge template

Insert scaled images on merge fields

Insert a page number field into Word documents

Insert or edit watermark in Word documents

Find or replace text in Word documents

Password protect Word documents or update document protection

Load & convert PDF documents to Word formats including DOC & DOCX

What is Aspose.Words Cloud SDK for PHP

Aspose.Words Cloud is a modern REST API, designed to perform a wide variety of operations on Word documents in the Cloud. The fundamental idea behind Words Cloud API is to incorporate a full-featured Word document processing functionality into customer’s applications, while providing high scalability and speed.

Similar to other Aspose Cloud SDKs, our PHP Cloud SDK is a wrapper around Cloud API, designed to be simple, efficient and secure. The SDK takes care of low-level details of an underlying REST API architecture, offers fewer opportunities to make mistakes, and lets developers focus on writing code specific to their particular project. As a result, it gets developers up and coding more quickly by putting Cloud API at their fingertips, along with providing PHP code samples and documentation.

For detailed information about the content in this SDK, including a description of new content, please see API Reference. Also have a look at the complete list of Aspose.Words Cloud SDKs.

Core Features and Functionality

With PHP Cloud API you can easily integrate Word conversion, generation, and editing features into PHP applications running on any modern OS. It allows you to work with a complete set of Word document components, such as main text, headers, footers, tables, sections, comments, drawing objects, fonts, hyperlinks, math objects, watermarks, and many others. PHP Cloud SDK assists in reading, editing, merging, splitting documents as well as converting a Word document to other supported file formats.

Since all our SDKs have been tested thoroughly before launch, our customers can be assured that PHP Cloud SDK is reliable, secure, and ready for production use in their apps.

You can easily and quickly test the API functionality you are interested in directly from web-browser with Aspose interactive Free Online Apps for Microsoft Word and OpenOffice documents. Have a look at our free online converter, viewer, editor, splitter, merger and other document processing tools.

PHP Cloud SDK Installation

Here go step-by-step instructions:

  1. Download, install and configure PHP 7.1 or higher version on your web-server.
  2. Download and install Composer tool for dependency management in PHP.
  3. Use “composer require aspose-cloud/aspose-words-cloud“ command to install PHP Cloud SDK from Packagist repository.

Getting started with PHP Cloud SDK

So you probably want to jump in and start creating your PHP application right away? The following code samples demonstrate how you would accomplish some typical tasks with the PHP Cloud SDK. You may use the PHP code samples in this section in your scripts and documentation. Also feel free to explore the Developer's Guide for other usage scenarios.
We welcome feedback, so feel free to contact us if you have a problem or question.

Please feel free to test the Cloud API functionality directly from your web browser with our online converter, viewer, editor, splitter, merger and other apps.

Convert PDF to Word in PHP

The following code sample shows how to convert PDF to DOCX in the Cloud and save the result to a local file:

Convert Word documents to PDF - PHP

use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests\ConvertDocumentRequest;

$appSid = "####-####-####-####-####";
$appKey = "##################";
$wordsApi = new WordsApi($appSid, $appKey);

$request = new ConvertDocumentRequest("sample.pdf", "docx");
$result = $wordsApi->convertDocument($request);
// Save an output file as "sample.docx"
rename($result->getPathname(), 'sample.docx');

Support and Learning Resources