1. Products
  2.   Word Processing
  3.   PHP
  4.   Aspose.Words Cloud SDK for PHP

Aspose.Words Cloud SDK for PHP

 
 

PHP API to Create & Process Microsoft Word Documents

REST API for Creating, Editing, Splitting, Merging, Manipulating, and Converting Word (DOC, DOCX, ODT) to PDF, HTML, EPUB, Images & more in PHP Apps.

Aspose.Words Cloud SDK for PHP is a powerful PHP REST API designed to streamline PHP word processing within modern applications. It enables developers to create Word processing files in PHP, edit Word documents PHP, and manage document metadata like author, title, and keywords—all through the cloud. This free Word processing API simplifies tasks such as generating, modifying, and converting DOCX files across various platforms. With its fast and secure architecture, developers can easily integrate Word document functionality into any PHP-based app while boosting efficiency and reducing development costs.

Beyond basic editing, the DOCX PHP REST API offers advanced features to manage Word documents PHP in a robust way. Developers can add bookmarks, search and replace text, insert or retrieve comments, handle headers, footers, and tables, and even manage fields and footnotes with ease. You can also convert Word documents PHP into more than 20 popular formats including PDF, HTML, EPUB, BMP, and PNG. Whether performing Mail Merge operations or extracting fonts, this versatile SDK allows developers to build scalable and feature-rich document workflows right inside their PHP apps.

Previous Next

Getting Started with Aspose.Words Cloud PHP REST API

Download, install and configure PHP 7.1 or higher version on your web-server. The recommend way to install Aspose.Words Cloud PHP REST API is using Composer. Please use the following command for a smooth installation.

Install Aspose.Words Cloud PHP REST API via Composer

composer require aspose-cloud/aspose-words-cloud 
You can also download it directly from GitHub.

Generate & Manage Word Documents via PHP REST API

Aspose.Words Cloud PHP REST API has provided complete support for creating new Word documents from the scratch inside PHP applications. The library fully supports several basic as well as advanced features for Word documents creation and processing such as add new pages, compress a Word document online, access and modify document properties, get statistics on a Word document, protect word documents, render parts of a Word document into an image, remove all macros from a Word document and many more.

How to Create New Word Documents via PHP REST API?

 
<php
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests\{CreateDocumentRequest};

$clientId = '####-####-####-####-####';
$secret = '##################';
$wordsApi = new WordsApi($clientId, $secret);
$createRequest = new CreateDocumentRequest(
    "Sample.docx", NULL, NULL);
$wordsApi->createDocument($createRequest); ?>

Convert Word Documents using PHP REST API

Aspose.Words Cloud PHP REST API allows software developers to convert Microsoft Word and OpenOffice documents to other supported file formats with high quality and speed. The library supports conversion to various popular file formats such as DOCX, DOC, RTF, ODT, PDF, HTML, MD, XAML, TXT, PNG, JPG and many others. The library also included various other popular documents conversions such as, Convert PDF to Word, Convert Word to PDF, Convert MOBI to EPUB, Convert MOBI to PDF, Convert Word to EPUB, Convert Word to Image, Convert Word to HTML and many more.

How to convert PDF to Word Programmatically via PHP REST API?

 
<php

use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests\{SaveAsOnlineRequest};
use Aspose\Words\Model\{SaveOptionsData};
$clientId = '####-####-####-####-####';
$secret = '##################';
$wordsApi = new WordsApi($clientId, $secret);
$requestDocument = "Sample.docx";
$requestSaveOptionsData = new SaveOptionsData(array(
"save_format" => "pdf",
"file_name" => "Sample_out.pdf",));
$saveRequest = new SaveAsOnlineRequest(
$requestDocument, $requestSaveOptionsData, NULL, NULL, NULL, NULL);
$wordsApi->saveAsOnline($saveRequest); ?>

Comparing Multiple Word Documents via PHP

Aspose.Words Cloud SDK for PHP enables software developers to compare their Word documents with just couple of lines of PHP code. The library allows programmatically comparing two Word documents and retrieving the differences between them. The library supports displaying the result of the documents comparison and can include information about the type of difference such as updated text, deleted text, newly added text, formatting change and so on. It may provide information about the location of the difference in the document, and the text that was added or deleted.

Generate Report via PHP library

Aspose.Words Cloud SDK for PHP has provided complete functionality for generating professional print-ready DOCX, DOC, RTF, PDF reports from templates inside PHP applications. To generate a report, first you need to prepare your source data in JSON, XML or CSV formats, then Create a report template and write a simple PHP application to bind the data to the template and produce the output document.  

How to Run Report Generation Process using PHP Commands?

<php
use Aspose\Words\WordsApi;
use Aspose\Words\Model\Requests\{BuildReportOnlineRequest};
use Aspose\Words\Model\{ReportEngineSettings};

$clientId = '####-####-####-####-####';
$secret = '##################';
$wordsApi = new WordsApi($clientId, $secret);
$requestTemplate = "Sample.docx";
$requestReportEngineSettings = new ReportEngineSettings(array(
    "data_source_type" => "Json",
    "data_source_name" => "persons",));
$buildReportRequest = new BuildReportOnlineRequest(
    $requestTemplate, "Data.json", $requestReportEngineSettings, NULL);
$wordsApi->buildReportOnline($buildReportRequest); ?>
 English