
Aspose.Diagram Cloud SDK for Swift
Swift REST API to Create, Manage & Export Visio Diagrams
A Powerful Swift REST SDK enables Software Developers to Generate, Edit, Render, Manipulate and Convert Visio Diagrams Formats like VSD, VSDX, VSS, VSSX, VST & more in Cloud.
What is Aspose.Diagram Cloud SDK for Swift?
If you are a software developer, you know how important it is to have the right tools for creating and managing documents. Aspose, a top provider of document processing APIs, has launched the Aspose.Diagram Cloud SDK for Swift. This tool is a game-changer for developers who handle Microsoft Visio diagram files. It simplifies the process of working with diagrams inside your Swift projects. The SDK is easy to connect with cloud storage services. This feature enables you to access, save, and fetch diagrams from different cloud platforms such as Amazon S3, Google Cloud Storage, and more. It’s a valuable tool for software developers wanting to handle different diagram types within their Swift applications.
The Aspose.Diagram Cloud SDK for Swift is a top-notch tool for Swift developers. It lets you handle different diagram files easily. With this kit, you can do a lot without needing complicated code or spending hours on manual work. This SDK empowers you to do various tasks with Microsoft Visio diagrams. You can create new diagrams, tweak existing ones, conversion of diagrams to different file formats, high-quality diagram rendering, manipulating existing diagrams and so much more. The SDK offers various features and is easy to use, making it simple for you to create, edit, and convert diagrams. In the constantly changing world of software development, having the correct tools can greatly boost your efficiency and project excellence. Aspose.Diagram Cloud SDK for Swift shows Aspose’s dedication to offering excellent solutions to developers.
Getting Started with Aspose.Diagram Cloud SDK for Swift
The recommend way to install Aspose.Diagram Cloud SDK for Swift is using CocoaPods. Please use the following command for a smooth installation.
Install Aspose.Diagram Cloud SDK for Swift via CocoaPods
target 'MyApp' do
pod 'AsposeDiagramCloud', '~> 20.3'
end
You can also download it directly from Aspose product page.Generate New Visio Diagram via Swift
Aspose.Diagram Cloud SDK for Swift enables Software developers to create new diagrams from scratch inside their Swift applications. The SDK provides various important functions for handling Visio diagrams, such as adding shapes to a diagram, using connectors, inserting text & other elements and various attributes to craft the perfect diagram with ease. The SDK makes it easy for developers to design custom diagrams that suit their specific needs. The following example demonstrates how software developers can create new VDX diagram inside Swift applications.
How to Create New VDX Diagram via Swift API?
# Get your ClientId and ClientSecret from https://dashboard.aspose.cloud (free registration required).
my $config = AsposeDiagramCloud::Configuration->new(app_sid => 'MY_CLIENT_ID', app_key => 'MY_CLIENT_SECRET');
my $client = AsposeDiagramCloud::ApiClient->new( $config);
my $diagram_api = AsposeDiagramCloud::DiagramApi->new($client);
my $result = $diagram_api->diagram_name_put(name => 'sample.vdx', folder => 'output', is_overwrite => 'true', storage => 'My_Storage_Name');
Visio Format Conversion via Swift API
The Aspose.Diagram Cloud SDK for Swift makes is easy for software developers to load and convert Microsoft Visio Diagrams to different file formats, making it easy to adapt your diagrams to various needs and platforms. This feature is particularly useful when you need to work with diagrams in different file formats. It supports conversion to numerous file formats, such as PDF, XPS, HTML, XAML, SWF, JPEG, PNG, BMP, TIFF, SVG, EMF and many more. The following Swift code example shows how to convert Visio diagram to another format.
How to Convert Visio Diagram to Other File Format via Swift Code?
import AsposeDiagramCloud
// Initialize the Configuration
let configuration = Configuration(apiKey: "yourAPIKey")
// Create a DiagramApi instance
let diagramApi = DiagramApi(configuration: configuration)
// Define the input file name (Visio diagram)
let fileName = "yourDiagramFileName.vsdx"
// Define the output file name (PDF)
let outputFileName = "output.pdf"
// Define the output format
let format = "pdf"
// Convert the Visio diagram to PDF
diagramApi.diagramConvertToFormat(fileName: fileName, format: format, outputFileName: outputFileName) { (response, error) in
if let error = error {
print("Error: \(error)")
} else {
if let data = response {
// Save or process the converted file (PDF in this case)
// For example, save it to a local file
if let fileData = Data(base64Encoded: data) {
let outputPath = FileManager.default.urls(for: .documentDirectory, in: .userDomainMask)[0].appendingPathComponent(outputFileName)
do {
try fileData.write(to: outputPath)
print("Conversion successful. Output file saved at: \(outputPath.path)")
} catch {
print("Error saving the output file: \(error)")
}
} else {
print("Error: Unable to decode the response data.")
}
} else {
print("Error: No response data received.")
}
}
}
Extract Data from Visio Diagrams via Swift API
Aspose.Diagram Cloud SDK for Swift is a powerful tool that allows developers to extract data from Visio diagrams in a straightforward and efficient manner inside Swift applications. With this SDK, you can access and parse Visio diagrams, retrieving essential information, shapes, and properties to work with the data as needed. It support extraction of shapes, text, and metadata, for further analysis or integration into other applications. Moreover, the SDK enables the manipulation of shapes within diagrams, allowing software developers to reposition, resize, and style shapes as needed.
Visio Diagrams Rendering
High-quality rendering is crucial for creating professional diagrams. Aspose.Diagram Cloud SDK for Swift ensures that your diagrams appear crisp and clear, whether on a web application or in a print document. The SDK is designed to work on various platforms, making it versatile for your Swift applications.