new FileFormatUtil()

Methods

static

detectFileFormat(stream) → FileFormatInfo

Detects and returns the information about a format of a visio stored in a stream.

Parameter

Name Type Optional Description

stream

InputStream

 

The stream

Returns

FileFormatInfo A FileFormatInfo object that contains the detected information.

static

detectFileFormat(filePath) → FileFormatInfo

Detects and returns the information about a format of a visio stored in a file.

Example

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
info = aspose.diagram.FileFormatUtil.detectFileFormat("example.vsdx");
console.log("detect result: " + info.getFileFormatType());

Parameter

Name Type Optional Description

filePath

String

 

The file path.

Returns

FileFormatInfo A FileFormatInfo object that contains the detected information.

static

detectFileFormatFromStream(stream, callback) → FileFormatInfo

Detects and returns the information about a format of a visio stored in a stream.

Example

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
var fs = require("fs");
var readStream = fs.createReadStream("example.vsdx");
aspose.diagram.FileFormatUtil.detectFileFormatFromStream(readStream, function(result, err) {
if (!err) {
console.log("detect result: " + result.getFileFormatType());
}
});

Parameters

Name Type Optional Description

stream

ReadableStream

 

The stream

callback

Callback

 

The callback function

Returns

FileFormatInfo A FileFormatInfo object that contains the detected information.