How to Convert an RTF File to JPG 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\ConvertDocumentApi(


new GuzzleHttp\Client(),
$config
);
$input_file = "/path/to/inputfile"; // \SplFileObject | Input file to perform the operation on.
$quality = 56; // int | Optional; Set the JPEG quality level; lowest quality is 1 (highest compression), highest quality (lowest compression) is 100; recommended value is 75. Default value is 75.
try {
$result = $apiInstance->convertDocumentRtfToJpg($input_file, $quality);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ConvertDocumentApi->convertDocumentRtfToJpg: ', $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

Python Packages For Data Science

Microservice Canvas

How to Know if My Corrupted Access Database is Beyond Recovery

Squanchy and Firestore rules — a security post-mortem

How Platform.sh can simplify your contribution workflow on GitHub

Merapar DevOps — CloudFormation macros to create dynamic CloudWatch Dashboards

Organizing teams to deliver microservices architecture

SQLite Triggers (+ Android Room)

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

Introduction: Getting started “REST API” with Lumen

Laravel Backend — Handling Double Post Requests on SPAs caused by Browser Retries of an HTTP…

Real-Time Private Chat Application using PHP Ratchet Websockets

Computer Based Testing System