How to Convert HTML to DOCX in PHP

composer require cloudmersive/cloudmersive_document_convert_api_client
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure API key authorization: Apikey
$config = Swagger\Client\Configuration::getDefaultConfiguration()->setApiKey('Apikey', 'YOUR_API_KEY');
$apiInstance = new Swagger\Client\Api\ConvertWebApi(


new GuzzleHttp\Client(),
$config
);
$input_request = new \Swagger\Client\Model\HtmlToOfficeRequest(); // \Swagger\Client\Model\HtmlToOfficeRequest | HTML input to convert to DOCX
try {
$result = $apiInstance->convertWebHtmlToDocx($input_request);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ConvertWebApi->convertWebHtmlToDocx: ', $e->getMessage(), PHP_EOL;
}
?>

--

--

--

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Community Update S1E1

Creating Azure Virtual Machine using ARM Template via Ansible Tower

My escape from tutorial hell.

Spark Stream part 1: build data pipelines with Spark Structured Streaming

Grant Cardone Teams Up With Gallant Dill On New Software “Business Tool Kit!”

Use GraphQL Codegen to reduce boilerplate code

AWS-RDS TASK/ ARTH TASK-18

How to quickly check out interesting warnings given by the PVS-Studio analyzer for C and C++ code?

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cloudmersive

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Offline Storage with IndexedDB — Part 1

EasyTpl — Simple and fastly template engine for PHP

Top 10 PHP 8.1 Features You Should Start Using Now

Get CRUD System with Live Input Data Validation using PHP with Free Source Code