<dependency>
<groupId>com.aspose</groupId>
<artifactId>aspose-diagram-cloud</artifactId>
<version>20.3</version>
</dependency>
copied!  
compile(group: 'com.aspose', name: 'aspose-diagram-cloud', version: '20.3')
copied!  
<dependency org="com.aspose" name="aspose-diagram-cloud" rev="20.3">
 <artifact name="aspose-diagram-cloud" ext="jar"/>
</dependency>
copied!  
libraryDependencies += "com.aspose" % "aspose-diagram-cloud" % "20.3"
copied!  


Docs Swagger Examples Blog Release Notes Support Dashboard


Create & Manage Visio® Diagrams with Java Cloud REST API

Aspose.Diagram Cloud SDK for Java enables developers to create, convert, and manage Microsoft Visio® diagrams directly within their Java applications, without requiring Microsoft Visio® to be installed. The SDK supports multiple diagram file formats, including VSDX, VDX, PDF, and others, ensuring seamless integration with cloud services and REST APIs. Java developers can upload, download, and manipulate diagrams across different platforms, including web, desktop, and mobile. With OAuth authentication, this SDK ensures secure and reliable diagram processing in the cloud. Perfect for Java developers looking to handle Visio® diagrams in their cloud-based applications.

Convert Diagram File

Convert Format

Convert Visio diagram files to different formats using the endpoint /diagram/{name}/SaveAs.

Save Options

Convert diagrams to popular formats like PDF and receive a link to the saved file.

Get Diagram Information

Retrieve Info

Extract diagram details such as page names and shapes through /diagram/{name}.

Upload Diagram File

Upload to Cloud

Upload a Visio diagram file to Cloud Storage with /diagram/{name}/upload.

Create Diagram File

Create New

Generate a new empty diagram file in a specified format using /diagram/{name}.

Manage Files and Storage

Download File

Download files from Cloud Storage via /diagram/storage/file/{path}.

Upload File

Upload files to Cloud Storage using /diagram/storage/file/{path}.

Copy File

Copy files to a new location in Cloud Storage using /diagram/storage/file/copy/{srcPath}.

Move File

Move files across Cloud Storage using /diagram/storage/file/move/{srcPath}.

Delete File

Remove files from Cloud Storage using /diagram/storage/file/{path}.

Supported File Formats

FormatDescriptionLoadSave
VSDXMicrosoft Visio Drawing that uses OPC (Open Packaging Conventions)✔️✔️
VDXDrawing or chart created with Microsoft Visio✔️✔️
VSDVisio Drawing (Vector Graphics File Format)✔️
VSXVisio Stencil XML file type✔️✔️
VTXXML for Visio (Template File)✔️✔️
VSSXVisio Stencil file with objects for technical drawings✔️✔️
VSTXMicrosoft Visio Drawing Template✔️✔️
VSDMVisio Macro-Enabled Drawing file type✔️✔️
VSSMStores a collection of shapes✔️✔️
VSTMVisio Drawing Template with macros✔️✔️
VDWVisio Web Drawing File Type✔️
VSSVisio Stencil File Type✔️
VSTVST Template File✔️
PDFPortable Document Format✔️
XPSXML Paper Specification format✔️
XAMLXML Application Markup Language✔️
SWFAdobe Flash File✔️
SVGScalable Vector Graphics (XML-based vector image)✔️
EMFEnhanced MetaFile✔️
JPEGJoint Photographic Experts Group format✔️
PNGPortable Network Graphics format✔️
BMPBitmap Image Format✔️
TIFFSingle or Multi-Page TIFF Image✔️
HTMLHyperText Markup Language✔️

Supported Platforms

PlatformDescription
JavaFully supported via REST API in Java applications.
.NETSupported through REST API in .NET applications.
PHPAccessible via REST API in PHP applications.
RubyAvailable via REST API in Ruby applications.
PythonSupported through REST API in Python applications.
Node.jsAccessible via REST API in Node.js applications.
WebUsable in web-based platforms via REST API.
DesktopCompatible with desktop environments via REST API.
MobileSupported on mobile platforms through REST API.
CloudWorks with various cloud platforms using REST API.

Requirements

  • Java 1.7+
  • Maven

Prerequisites

To use Aspose.Diagram Cloud SDK for Java, register an account with Aspose Cloud and obtain your Client ID and Client Secret from the Cloud Dashboard. A free quota is available; see Aspose Cloud Pricing for details.

Installation

Install from Maven

Add the Aspose Cloud repository to your application’s pom.xml:

<repositories>
    <repository>
        <id>AsposeJavaAPI</id>
        <name>Aspose Java API</name>
        <url>https://releases.aspose.cloud/java/repo/</url>
    </repository>
</repositories>

Install from Source

To install the API client library locally:

mvn clean install

To deploy it to a remote Maven repository, configure your repository settings and run:

mvn clean deploy

Maven Users

Add this dependency to your project’s pom.xml:

<dependencies>
    <dependency>
        <groupId>com.aspose</groupId>
        <artifactId>aspose-diagram-cloud</artifactId>
        <version>20.3</version>
    </dependency>
</dependencies>

Others

Generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/aspose-diagram-cloud-20.3.jar
  • target/lib/*.jar

Authorization & Authentication

The SDK uses JWT for authentication:

  • Type: OAuth
  • Flow: application
  • Authorization URL: https://api.aspose.cloud/connect/token

Recommendation

In a multithreaded environment, create an instance of ApiClient per thread to avoid potential issues.

Convert Microsoft Visio (VDX) to PDF

Learn how to convert a Visio diagram (VDX) file to a PDF format with Aspose.Diagram Cloud SDK for Java. This example provides a simple way to use REST APIs to convert VDX files to high-quality PDFs for easy sharing and archiving.

import com.aspose.cloud.diagram.api.DiagramApi;
import com.aspose.cloud.diagram.model.PdfSaveOptions;
import com.aspose.cloud.diagram.model.SaveOptionsRequest;
import com.aspose.cloud.diagram.model.SaveAsResponse;

public class ConvertVDXToPDF {
    public static void main(String[] args) {
        try {
            // Initialize the DiagramApi with credentials (get Client ID and Secret from https://dashboard.aspose.cloud)
            DiagramApi diagramApi = new DiagramApi("client_credentials", "YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");

            // Define the input file name and output folder
            String fileName = "sample.vdx";
            String folder = "output_folder";

            // Set up save options to convert to PDF
            SaveOptionsRequest request = new SaveOptionsRequest();
            request.setFileName("output.pdf");
            request.setFolder(folder);

            PdfSaveOptions saveOptions = new PdfSaveOptions();
            saveOptions.setIsExportComments(true);
            saveOptions.setJpegQuality(100);
            request.setSaveOptions(saveOptions);

            // Convert VDX to PDF
            SaveAsResponse response = diagramApi.saveAs(fileName, request, folder, true);
            System.out.println("PDF File Saved: " + response.getSavedFile());
        } catch (Exception e) {
            System.err.println("Error occurred: " + e.getMessage());
        }
    }
}

Convert Microsoft Visio (VDX) to PNG

Convert a Visio diagram (VDX) to a PNG image using Aspose.Diagram Cloud SDK for Java. This example demonstrates how to use cloud-based REST APIs to generate PNG images from Visio files.

import com.aspose.cloud.diagram.api.DiagramApi;
import com.aspose.cloud.diagram.model.ImageSaveOptions;
import com.aspose.cloud.diagram.model.SaveOptionsRequest;
import com.aspose.cloud.diagram.model.SaveAsResponse;

public class ConvertVDXToPNG {
    public static void main(String[] args) {
        try {
            // Initialize the DiagramApi
            DiagramApi diagramApi = new DiagramApi("client_credentials", "YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");

            // Define the input file and folder
            String fileName = "sample.vdx";
            String folder = "output_folder";

            // Set up save options to convert to PNG
            SaveOptionsRequest request = new SaveOptionsRequest();
            request.setFileName("output.png");
            request.setFolder(folder);

            ImageSaveOptions saveOptions = new ImageSaveOptions();
            saveOptions.setIsExportComments(true);
            saveOptions.setJpegQuality(100);
            request.setSaveOptions(saveOptions);

            // Convert VDX to PNG
            SaveAsResponse response = diagramApi.saveAs(fileName, request, folder, true);
            System.out.println("PNG File Saved: " + response.getSavedFile());
        } catch (Exception e) {
            System.err.println("Error occurred: " + e.getMessage());
        }
    }
}

Create a New Microsoft Visio (VDX) Diagram

Learn how to create a new Microsoft Visio (VDX) diagram from scratch using Aspose.Diagram Cloud SDK for Java. This example guides you through creating a new diagram file in the cloud.

import com.aspose.cloud.diagram.api.DiagramApi;
import com.aspose.cloud.diagram.model.CreateNewResponse;

public class CreateVDXDiagram {
    public static void main(String[] args) {
        try {
            // Initialize the DiagramApi with credentials
            DiagramApi diagramApi = new DiagramApi("client_credentials", "YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");

            // Define the new diagram name and folder
            String newDiagramName = "newDiagram.vdx";
            String folder = "output_folder";

            // Create a new VDX diagram
            CreateNewResponse response = diagramApi.createNew(newDiagramName, folder, true);
            System.out.println("New Diagram Created: " + response.getCreated());
        } catch (Exception e) {
            System.err.println("Error occurred: " + e.getMessage());
        }
    }
}

Convert Microsoft Visio (VDX) to SVG

This example demonstrates how to convert a Visio (VDX) file to SVG format using Aspose.Diagram Cloud SDK for Java, ideal for scalable vector graphics output.

import com.aspose.cloud.diagram.api.DiagramApi;
import com.aspose.cloud.diagram.model.SVGSaveOptions;
import com.aspose.cloud.diagram.model.SaveOptionsRequest;
import com.aspose.cloud.diagram.model.SaveAsResponse;

public class ConvertVDXToSVG {
    public static void main(String[] args) {
        try {
            // Initialize the DiagramApi with credentials
            DiagramApi diagramApi = new DiagramApi("client_credentials", "YOUR_CLIENT_ID", "YOUR_CLIENT_SECRET");

            // Define the input file and folder
            String fileName = "sample.vdx";
            String folder = "output_folder";

            // Set up save options to convert to SVG
            SaveOptionsRequest request = new SaveOptionsRequest();
            request.setFileName("output.svg");
            request.setFolder(folder);

            SVGSaveOptions saveOptions = new SVGSaveOptions();
            saveOptions.setQuality(100);
            request.setSaveOptions(saveOptions);

            // Convert VDX to SVG
            SaveAsResponse response = diagramApi.saveAs(fileName, request, folder, true);
            System.out.println("SVG File Saved: " + response.getSavedFile());
        } catch (Exception e) {
            System.err.println("Error occurred: " + e.getMessage());
        }
    }
}

Aspose.Diagram Cloud SKDs

GitHub

GitHub GitHub GitHub GitHub GitHub GitHub GitHub GitHub GitHub

Package Manager

NuGet Maven Composer PyPI RubyGems Node.js Android Perl Swift


Docs Swagger Examples Blog Release Notes Support Dashboard

VersionRelease Date
20.3April 26, 2020
19.10November 4, 2019
18.10January 8, 2019