SDKs overview
Vector Express v2.0 provides software development kits (SDKs) and client libraries designed to facilitate the integration of its vectorization capabilities into various applications. These SDKs abstract the underlying API interactions, allowing developers to programmatically convert documents and images into vector formats such as SVG and DXF, and leverage the AI Vectorizer feature. Access to the API and SDKs is managed through an API key, as detailed in the Vector Express v2.0 official documentation.
The official SDKs support multiple programming languages, enabling developers to choose a client library that aligns with their existing technology stack. Beyond official offerings, community-contributed libraries may also exist, providing additional language support or specialized functionalities, though their maintenance and support typically differ from officially provided resources. The primary focus of these SDKs is to streamline common tasks such as uploading source files, specifying conversion parameters, and retrieving processed vector output.
Official SDKs by language
Vector Express v2.0 offers official SDKs for several popular programming languages. These libraries are maintained by Vector Express and provide a structured way to interact with the API, handling aspects like authentication, request formatting, and response parsing. The table below outlines the currently available official SDKs, their respective package managers, and general maturity status.
| Language | Package Name | Install Command (Example) | Maturity |
|---|---|---|---|
| Node.js | @vector-express/nodejs-sdk |
npm install @vector-express/nodejs-sdk |
Stable |
| Python | vector-express-python |
pip install vector-express-python |
Stable |
| Go | github.com/vector-express/go-sdk |
go get github.com/vector-express/go-sdk |
Stable |
| Ruby | vector-express-ruby |
gem install vector-express-ruby |
Stable |
Each SDK is designed to encapsulate the API's functionality, from initiating conversion requests for PDF to SVG conversion to managing asynchronous operations and retrieving results. Detailed API definitions and endpoint specifics are available on the Vector Express v2.0 API reference page.
Installation
To begin using a Vector Express v2.0 SDK, developers typically install the corresponding package using the standard package manager for their chosen language. This process fetches the library and its dependencies, making the SDK's functions available within the development environment.
Node.js
For Node.js environments, the official SDK is available via npm, the Node package manager. Developers can integrate it into their project using the following command:
npm install @vector-express/nodejs-sdk
After installation, the package can be imported into JavaScript or TypeScript files to access the client methods for API interaction, as described in the Node.js SDK documentation.
Python
Python developers can install the official SDK using pip, Python's package installer. This command adds the library to the project's dependencies:
pip install vector-express-python
Once installed, the library can be imported into Python scripts. The Python SDK guide provides further details on configuration and usage patterns.
Go
Go projects use go get to retrieve and install external packages, including the Vector Express v2.0 Go SDK:
go get github.com/vector-express/go-sdk
Following installation, the package can be imported and utilized in Go source files to interact with the Vector Express API. Refer to the Go SDK specific instructions for implementation guidance.
Ruby
Ruby developers can install the official SDK using Bundler or directly with the gem command:
gem install vector-express-ruby
Upon installation, the Ruby client library becomes available for integration into Ruby applications. The Ruby SDK documentation covers its methods and best practices.
Quickstart example
The following Node.js example demonstrates how to use the Vector Express v2.0 SDK to convert a PDF document to an SVG vector format. This process typically involves initializing the client with an API key, specifying the input file and desired output format, and then executing the conversion request.
const { VectorExpressClient } = require('@vector-express/nodejs-sdk');
const fs = require('fs');
const apiKey = 'YOUR_API_KEY'; // Replace with your actual API Key
const client = new VectorExpressClient(apiKey);
async function convertPdfToSvg() {
try {
const filePath = './input.pdf'; // Path to your PDF file
const outputFormat = 'svg';
// Ensure the input file exists for demonstration
if (!fs.existsSync(filePath)) {
console.error(`Error: Input file ${filePath} not found.`);
return;
}
console.log(`Starting conversion of ${filePath} to ${outputFormat}...`);
const result = await client.convert({
file: fs.createReadStream(filePath),
output_format: outputFormat,
});
// Handle the result, typically a stream or buffer of the converted file
// For this example, we'll save it to a file.
const outputFilePath = './output.svg';
fs.writeFileSync(outputFilePath, result);
console.log(`Conversion successful! Output saved to ${outputFilePath}`);
} catch (error) {
console.error('Conversion failed:', error.message);
if (error.response && error.response.data) {
console.error('API Error Details:', error.response.data);
}
}
}
convertPdfToSvg();
This example assumes you have an input.pdf file in the same directory as your script and your Vector Express API key. The converted SVG content is written to output.svg. For handling errors, the example includes a basic structure to catch and log issues, including potential API response data. Developers should replace YOUR_API_KEY with their actual API key obtained from their Vector Express account. Detailed instructions on obtaining and managing API keys are provided in the Vector Express authentication guide.
Community libraries
While Vector Express v2.0 provides official SDKs, the developer community sometimes contributes additional libraries or integrations. These community-maintained resources may offer support for other programming languages, specialized utilities, or integrations with specific frameworks not covered by official SDKs. Examples include wrappers for less common languages or plugins for content management systems. For instance, developers often share open-source tools on platforms like GitHub or through language-specific package repositories (e.g., PyPI for Python, RubyGems for Ruby).
Community libraries are generally developed independently of Vector Express and their maintenance status, support, and compatibility with future API versions can vary. Developers considering using community-contributed libraries are advised to review the project's documentation, community activity, and licensing information. These resources can be discovered through searches on GitHub topics related to Vector Express or through forums where developers discuss web API integration patterns.