This repository contains Aspose.HTML Cloud SDK for Python source code. This SDK allows you to work with Aspose.HTML Cloud REST APIs in your Python applications quickly and easily.
See API Reference for full API specification.
The complete source code is available in this repository folder, you can either directly use it in your project via pip package manager.
To use Aspose HTML for Cloud Python 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.
From the command line:
python setup.py install
pip install asposehtmlcloud
The examples below show how your application have to initiate and convert url to image using Aspose.HTML Cloud library:
import os
from asposehtmlcloud.configuration import Configuration
from asposehtmlcloud.api.html_api import HtmlApi
from asposehtmlcloud.rest import ApiException
from shutil import copy2
configuration = Configuration(apiKey="XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
appSid="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
basePath="https://api.aspose.cloud/v1.1",
authPath="https://api.aspose.cloud/oauth2/token",
debug=True)
api = HtmlApi(configuration)
source_url = "https://stallman.org/articles/anonymous-payments-thru-phones.html"
try:
# Convert url to image
res = api.get_convert_document_to_image_by_url(
source_url, out_format="jpeg", width=800, height=1000, left_margin=50, right_margin=100,
top_margin=150, bottom_margin=200, x_resolution=300, y_resolution=300,
folder="MY_REMOTE_FOLDER", storage=""
)
src = str(res)
# Move to test folder
if os.path.isfile(src):
copy2(src, '/home/user/testfolder/')
os.remove(src)
except ApiException as ex:
print("Exception")
print("Info: " + str(ex))
raise ex
# ...
Tests contain various examples of using the Aspose.HTML SDK.
Docs Full documentation for Aspose.HTML Api SDK
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.
Tests contain various examples of using the Aspose.Storage SDK.
Docs Full documentation for Aspose.Storage Api SDK
Your feedback is very important to us. Please feel free to contact us using our Support Forums.