aspose.html.sdk.v140

Aspose HTML SDK for C++ is a programming SDK that allows software developers to manipulate and convert HTML documents from within their own applications. A Wrapper of RESTful APIs, Aspose HTML SDK for C++ speeds up HTML programming and conversion. Aspose Html SDK for C++ is a cross-platform C++ library that enables your applications to perform a great range of html document processing tasks. With Aspose.Html C++ you can load, save and convert html between the following formats: JPG, GIF, BMP, PDF, TIFF, MHTML. With Aspose.Html you can generate, modify, convert in html documents. Aspose Html SDK for C++ is well documented to help you create your solutions on different platforms. Platform Independence Aspose Html SDK for C++ library can be assembled for different platforms using various modern compilers which support C++14, such as Microsoft Visual C++, GCC, Clang and MinGW.


Keywords
native, aspose.html, html, conversion, pdf, xps, image, xpath, css, md, mhtml, template, downloader
License
MIT
Install
Install-Package aspose.html.sdk.v140 -Version 19.6.0

Documentation

Aspose HTML Cloud SDK C++

AsposeHtml - the C++ library for the Aspose.HTML Cloud API Reference

  • API version: 3.0
  • Package version: 19.5.0

Requirements

Installation

Load from git

git clone https://github.com/aspose-html-cloud/aspose-html-cloud-cpp.git
cd aspose-html-cloud-cpp

Getting Started

To use Aspose HTML for Cloud SDK you need to register an account with Aspose Cloud and lookup/create App Key and SID at Cloud Dashboard. There is free quota available. For more details, see Aspose Cloud Pricing.

    const utility::string_t clientId = _XPLATSTR("XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX");
    const utility::string_t clientSecret = _XPLATSTR("XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX");
    const utility::string_t basePath = _XPLATSTR("https://api.aspose.cloud/v3.0");
    const utility::string_t authPath = _XPLATSTR("https://api.aspose.cloud/connect/token");

    //Helper directory with data for test
    const utility::string_t testResult = _XPLATSTR("..\\testresult\\");

    //Create configuration for authorization
    std::shared_ptr<ApiConfiguration> apiConfig(new ApiConfiguration(clientId, clientSecret, basePath, authPath));

    //Create client from configuration
    std::shared_ptr<ApiClient> apiClient(new ApiClient(apiConfig));
    
    //Create ConversionApi
    ConversionApi *api = new ConversionApi(apiClient);

    //Parameters for conversion
    utility::string_t sourceUrl = _XPLATSTR("https://stallman.org/articles/anonymous-payments-thru-phones.html");
    boost::optional<int32_t> width = 800;
    boost::optional<int32_t> height = 1000;
    boost::optional<int32_t> leftMargin = 20;
    boost::optional<int32_t> rightMargin = 20;
    boost::optional<int32_t> topMargin = 20;
    boost::optional<int32_t> bottomMargin = 20;
    boost::optional<int32_t> resolution = 300;
    
    //Convert to png
	auto result = api->getConvertDocumentToImageByUrl(sourceUrl, _XPLATSTR("png"),
		width, height, leftMargin, rightMargin, topMargin, bottomMargin, resolution).get();

        
    //Save result to files
    std::ofstream saved_data(testresult + _XPLATSTR("ConvertResult.png"), std::ios::out | std::ios::binary);

    result.writeTo(saved_data);
    saved_data.close();
    
    delete api;

For use SDK see examples in test

Documentation for API Endpoints

All URIs are relative to https://api.aspose.cloud/v3.0

Aspose HTML includes Aspose.Storage.Cloud to manipulate files on a remote server. This is used in tests for download test files to the server.

oauth

Tests contain various examples of using the Aspose.HTML SDK.

Docs Documentation for Aspose.HTML Api SDK