aspose.diagram
Class FileFormatUtil

Provides utility methods for conveting file format enums to strings or file extensions and back.

Constructor Summary
FileFormatUtil()
          
 
Method Summary
static functiondetectFileFormat(filePath)
           Detects and returns the information about a format of a visio stored in a file.
static functiondetectFileFormatFromStream(stream, callback)
           Detects and returns the information about a format of a visio stored in a stream.
 

Constructor Detail

FileFormatUtil

function FileFormatUtil()

Method Detail

detectFileFormat

static function detectFileFormat(filePath)
Detects and returns the information about a format of a visio stored in a file.
Parameters:
filePath: String - The file path.
Returns:
A FileFormatInfo object that contains the detected information.

Example:

var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");

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

detectFileFormatFromStream

static function detectFileFormatFromStream(stream, callback)
Detects and returns the information about a format of a visio stored in a stream.
Parameters:
stream: ReadableStream - The stream
callback: Callback - The callback function
Returns:
A FileFormatInfo object that contains the detected information.

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());
    }
});
				

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.