Run this command to install the SDK:

npm install cloudmersive-convert-api-client --save


Or add this snippet to your package.json:

  "dependencies": {
    "cloudmersive-convert-api-client": "^2.0.2"
  }


var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');
var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;

// Configure API key authorization: Apikey
var Apikey = defaultClient.authentications['Apikey'];
Apikey.apiKey = 'YOUR API KEY';



var apiInstance = new CloudmersiveConvertApiClient.ConvertWebApi();

var input = new CloudmersiveConvertApiClient.HtmlToPdfRequest(); // HtmlToPdfRequest | HTML to PDF request parameters


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.convertWebHtmlToPdf(input, callback);

Run this command to install the SDK:

pip install git+https://github.com/Cloudmersive/Cloudmersive.APIClient.Python.Convert.git


from __future__ import print_function
import time
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.rest import ApiException
from pprint import pprint

# Configure API key authorization: Apikey
configuration = cloudmersive_convert_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'



# create an instance of the API class
api_instance = cloudmersive_convert_api_client.ConvertWebApi(cloudmersive_convert_api_client.ApiClient(configuration))
input = cloudmersive_convert_api_client.HtmlToPdfRequest() # HtmlToPdfRequest | HTML to PDF request parameters

try:
    # Convert HTML string to PDF
    api_response = api_instance.convert_web_html_to_pdf(input)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ConvertWebApi->convert_web_html_to_pdf: %s\n" % e)

Run this command to install the SDK:

Install-Package Cloudmersive.APIClient.NET.DocumentAndDataConvert -Version 1.3.4


using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Api;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model;

namespace Example
{
    public class ConvertWebHtmlToPdfExample
    {
        public void main()
        {
            // Configure API key authorization: Apikey
            Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
            
            

            var apiInstance = new ConvertWebApi();
            var input = new HtmlToPdfRequest(); // HtmlToPdfRequest | HTML to PDF request parameters

            try
            {
                // Convert HTML string to PDF
                byte[] result = apiInstance.ConvertWebHtmlToPdf(input);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling ConvertWebApi.ConvertWebHtmlToPdf: " + e.Message );
            }
        }
    }
}

To install with Maven, add a reference to the repository in pom.xml:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>


And add a reference to the dependency in pom.xml:

<dependencies>
<dependency>
    <groupId>com.github.Cloudmersive</groupId>
    <artifactId>Cloudmersive.APIClient.Java</artifactId>
    <version>v2.32</version>
</dependency>
</dependencies>


To install with Gradle, add it in your root build.gradle at the end of repositories:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}


And add the dependency in build.gradle:

dependencies {
        implementation 'com.github.Cloudmersive:Cloudmersive.APIClient.Java:v2.32'
}


// Import classes:
//import com.cloudmersive.client.invoker.ApiClient;
//import com.cloudmersive.client.invoker.ApiException;
//import com.cloudmersive.client.invoker.Configuration;
//import com.cloudmersive.client.invoker.auth.*;
//import com.cloudmersive.client.ConvertWebApi;

ApiClient defaultClient = Configuration.getDefaultApiClient();

// Configure API key authorization: Apikey
ApiKeyAuth Apikey = (ApiKeyAuth) defaultClient.getAuthentication("Apikey");
Apikey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//Apikey.setApiKeyPrefix("Token");

ConvertWebApi apiInstance = new ConvertWebApi();
HtmlToPdfRequest input = new HtmlToPdfRequest(); // HtmlToPdfRequest | HTML to PDF request parameters
try {
    byte[] result = apiInstance.convertWebHtmlToPdf(input);
    System.out.println(result);
} catch (ApiException e) {
    System.err.println("Exception when calling ConvertWebApi#convertWebHtmlToPdf");
    e.printStackTrace();
}

Run this command to install the SDK:

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 = new \Swagger\Client\Model\HtmlToPdfRequest(); // \Swagger\Client\Model\HtmlToPdfRequest | HTML to PDF request parameters

try {
    $result = $apiInstance->convertWebHtmlToPdf($input);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConvertWebApi->convertWebHtmlToPdf: ', $e->getMessage(), PHP_EOL;
}
?>

Add the Objective-C client to your Podfile:

pod 'CloudmersiveDocumentAndDataConvertApiClient', '~> 1.0'


CMDefaultConfiguration *apiConfig = [CMDefaultConfiguration sharedConfig];

// Configure API key authorization: (authentication scheme: Apikey)
[apiConfig setApiKey:@"YOUR_API_KEY" forApiKeyIdentifier:@"Apikey"];




CMHtmlToPdfRequest* input = [[CMHtmlToPdfRequest alloc] init]; // HTML to PDF request parameters

CMConvertWebApi*apiInstance = [[CMConvertWebApi alloc] init];

// Convert HTML string to PDF
[apiInstance convertWebHtmlToPdfWithInput:input
          completionHandler: ^(NSData* output, NSError* error) {
                        if (output) {
                            NSLog(@"%@", output);
                        }
                        if (error) {
                            NSLog(@"Error calling CMConvertWebApi->convertWebHtmlToPdf: %@", error);
                        }
                    }];

Add the Ruby client to your Gemfile:

gem 'cloudmersive-convert-api-client', '~> 1.3.3'


# load the gem
require 'cloudmersive-convert-api-client'
# setup authorization
CloudmersiveConvertApiClient.configure do |config|
  # Configure API key authorization: Apikey
  config.api_key['Apikey'] = 'YOUR API KEY'
  # Uncomment the following line to set a prefix for the API key, e.g. 'Bearer' (defaults to nil)
  #config.api_key_prefix['Apikey'] = 'Bearer'
end

api_instance = CloudmersiveConvertApiClient::ConvertWebApi.new

input = CloudmersiveConvertApiClient::HtmlToPdfRequest.new # HtmlToPdfRequest | HTML to PDF request parameters


begin
  #Convert HTML string to PDF
  result = api_instance.convert_web_html_to_pdf(input)
  p result
rescue CloudmersiveConvertApiClient::ApiError => e
  puts "Exception when calling ConvertWebApi->convert_web_html_to_pdf: #{e}"
end