Convert Word Documents in PHP
Convert Word Documents in PHP
Convert Word documents in PHP with a high-performance format conversion REST API. Create, combine, integrate document conversions of any type and scale into your systems to create workflows specific to your business tasks.
Aspose document conversion platform provides maximum performance and allows converting Word, OpenOffice, PDF, HTML, Markdown, E-Mail, Postscript, plain text and other documents in any direction with top quality and high speed. With PHP SDK you have 24/7 access to a full range of Document Automation and Conversion features, required by PHP developers to implement their document-processing solutions.
Our Cloud SDKs are available for all major operating systems (Windows, macOS, Linux, Android), favorite programming languages (Java, C#, C++, Python, Node.js, PHP, Golang, Ruby, Swift), Java and .NET frameworks.
Supported Document Formats
Almost all mainstream document formats are supported, including DOCX, DOC, RTF, ODT, PDF, HTML, MD, XAML, TXT, PNG, JPG and many others. The complete list of supported file formats is presented in the Cloud Documentation.
Words Cloud API supports conversions of multiple documents, conversion of Word documents from the outdated DOC format to the latest DOCX and in the opposite direction.
Convert Word Documents using PHP library
Aspose Cloud provides a powerful document conversion PHP library, designed to convert Word documents in PHP to and from Word-based formats, and also supports documents in various OpenOffice formats, E-Mail formats, PDF, HTML, Markdown, Postscript, XAML and plain text.Note: As a prerequisite, you need PHP and Words Cloud PHP library installed on your computer.
Convert PDF to Word in PHP
Aspose Words helps you to get the most of PDF and Words documents and use them in conjunction with each other. According to your document automation tasks, you may require to convert a write-protected PDF to an editable DOCX or DOC with formatting and content identical to the original PDF.
You can easily convert PDF to DOC with our PHP library. Aspose Cloud API allows converting PDF to various Word-based document formats, including DOCX, RTF and ODT.
If you need to extract text from a PDF document, just convert it to plain text with PDF to TXT conversion.
Convert Word to PDF in PHP
There are several reasons why you may need to convert a Word document to PDF format. Here are some of them:
- PDF is write-protected and you can confidently share it with others.
- PDF offers better security options than a Word document.
- PDF is perfect for long-term archiving.
- PDF is optimized for professional printing.
You can easily convert Word to PDF with PHP library. The output document will conform to the "PDF 1.5" or "PDF/A-1b" specification.
If you need to extract text from a Word document, just convert it to plain text with DOCX to TXT conversion.
Convert MOBI to EPUB
The increasing mainstream prominence of electronic books gives rise to a number of lightweight eBook formats, where MOBI and EPUB are the most popular. They are cross-platform and provide reflowable content. Like HTML they can adjust page representation in accordance with characteristics of the specific e-reader.
With PHP SDK you can easily convert MOBI to EPUB format. EPUB has greater support across all platforms, whereas MOBI is mainly an Amazon Kindle e-reader format.
Try our free online MOBI to EPUB eBook Converter.
Convert MOBI to PDF
PDF is also widely accepted as an eBook format. With PHP SDK you can convert eBook from MOBI format to more versatile PDF with ease.
Also, have a look at our online MOBI to PDF Converter. It is 100% free.
Convert Word to EPUB in PHP
With PHP SDK you can convert DOCX to EPUB, which is a widespread electronic book format. The original document content, formatting, images, hyperlinks and navigation would be fully compatible and operational in any electronic book reader.
Convert Word to Image in PHP
There is no built-in option in Microsoft Office to save a Word document as a set of images. Using Aspose PHP library you can easily convert DOCX to JPG, DOCX to PNG or any other image format.
Conversion supports both raster (JPG, GIF, PNG, etc.) and vector image formats (SVG, EMF, etc.).
Convert Word to HTML in PHP
PHP SDK provides an easy way to instantly convert Word document into perfect Web documents. Easily convert DOCX to HTML, Markdown, MHTML and other popular Web formats.
Getting Started with PHP library
- Go through our guide to convert a document to get you started in no time.
- Check out our GitHub repository for a complete API list along with working examples.
- Try our free online Converter.
How to Convert a DOCX in PHP
- Go to the Aspose Cloud Dashboard.
- Create a new Account to access all applications and services or Sign In to your account.
- Click on Applications in the left menu to get Client Id and Client Secret.
- Check API Reference page for the description of APIs parameters.
- Install PHP SDK library via composer.
- Check Developer Guide to convert DOCX to PDF, EPUB, JPG, etc.
use Aspose\Words\Model; use Aspose\Words\Model\Requests; use Aspose\Words\WordsApi; $appSid = "####-####-####-####-####"; $appKey = "##################"; $wordsApi = new WordsApi($appSid, $appKey); // Convert PDF to Word $request = new Requests\ConvertDocumentRequest("sample.pdf", "docx"); $result = $wordsApi->convertDocument($request); // Save the result to a local file rename($result->getPathname(), 'sample.docx'); // Convert DOCX to PDF if we have a document in the Storage $saveOptions = new Model\SaveOptionsData(array( "file_name" => "dest.pdf", "save_format" => "pdf")); $request = new Requests\SaveAsRequest('source.docx', $saveOptions); $wordsApi->saveAs($request); // Convert DOCX to HTML with advanced options $saveOptions = new Model\HtmlFixedSaveOptionsData(array( "export_embedded_css" => true, "css_class_names_prefix"=>"aspose_", "page_index" => 2, "page_count"=>3, "jpeg_quality" => 90, "file_name" => "sample.html", "save_format" => "html" )); $request = new Requests\SaveAsRequest("sample.docx", $saveOptions); $result = $wordsApi->saveAs($request);