This repository contains Aspose.HTML Cloud SDK source code. This SDK allows you to work with Aspose.HTML Cloud REST APIs in your 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.
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.
Before create configuration, then use HtmlAPI or StorageAPI (see tests)
Example:
import Alamofire
import Foundation
import XCTest
import AsposeHtmlCloud
static let fm = FileManager.default
let resourceDir = fm.homeDirectoryForCurrentUser.appendingPathComponent("Documents/Aspose.HTML.Cloud.SDK.Swift/Tests/AsposeHtmlCloudTests/Resources")
let resultDir = fm.homeDirectoryForCurrentUser.appendingPathComponent("Documents/Aspose.HTML.Cloud.SDK.Swift/Tests/AsposeHtmlCloudTests/TestResult")
func url(forResource fileName: String) -> URL {
return resourceDir.appendingPathComponent(fileName)
}
func fileExist(name: String) -> Bool {
return FileManager.default.fileExists(atPath: name)
}
ClientAPI.setConfig(
basePath: "https://api.aspose.cloud/v4.0",
authPath: "https://api.aspose.cloud/connect/token",
apiKey: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
appSID: "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
debugging: true
)
let fileName = "test1.html"
let src = url(forResource: fileName).absoluteString
let format = "jpeg"
let expectation = self.expectation(description: "testConvert to \(format)")
let dst = resultDir.appendingPathComponent("LocToLocDoc.\(format)").absoluteString
HtmlAPI.convertLocalToLocal(src: src, dst: dst, options: nil) { (data, error) in
guard error == nil else {
XCTFail("Error get convert html to \(format)). Error=\(error!.localizedDescription)")
return
}
let resultPath = data!.file!
XCTAssertTrue(fileExist(name: resultPath))
expectation.fulfill()
}
self.waitForExpectations(timeout: testTimeout, handler: nil)
All URIs are relative to https://api.aspose.cloud/v4.0
Class | Method | Description |
---|---|---|
HtmlAPI | convertLocalToLocal | Convert a document from local disk to a local disk. |
HtmlAPI | convertLocalToStorage | Convert a document from local disk to user's storage. |
HtmlAPI | convertStorageToLocal | Convert a document from user's storage to local disk. |
HtmlAPI | convertStorageToStorage | Convert a document from user's storage to user's storage. |
HtmlAPI | convertUrlToLocal | Convert the HTML document by URL to local disk. |
HtmlAPI | convertUrlToStorage | Convert the HTML document by URL to user's storage. |
HtmlAPI | convert | Convert a document to the specified format. |
Class | Method | Description |
---|---|---|
HtmlAPI | vectorizeLocalToLocal | Vectorize an image to the SVG format from local disk to a local disk. |
HtmlAPI | vectorizeLocalToStorage | Vectorize an image to the SVG format from local disk to user's storage. |
HtmlAPI | vectorizeStorageToLocal | Vectorize an image to the SVG format from user's storage to local disk. |
HtmlAPI | vectorizeStorageToStorage | Vectorize an image to the SVG format from user's storage to user's storage. |
HtmlAPI | vectorize | Vectorize an image to the SVG format. |
Test uses StorageApi for upload(download) file to(from) remote storage.
All URIs are relative to https://api.aspose.cloud/v4.0
Class | Method | Description |
---|---|---|
StorageAPI | deleteFile | Delete file |
StorageAPI | downloadFile | Download file |
StorageAPI | uploadFile | Upload file |
StorageAPI | createFolder | Create the folder |
StorageAPI | deleteFolder | Delete folder |
StorageAPI | getFilesList | Get all files and folders within a folder |
StorageAPI | getDiscUsage | Get disc usage |
StorageAPI | objectExists | Check if file or folder exists |
StorageAPI | storageExists | Check if storage exists |
Tests contain various examples of using the Aspose.HTML and Aspose.Storage SDK.
link |
Stars: 0 |
Last commit: 1 year ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics