Method Summary | ||
---|---|---|
static method | detectFileFormat(stream) | |
Detects and returns the information about a format of an excel stored in a stream. | ||
static method | detectFileFormat(filePath) | |
Detects and returns the information about a format of an excel stored in a file. | ||
static method | detectFileFormat(filePath, password) | |
Detects and returns the information about a format of an excel stored in a file. | ||
static method | detectFileFormatFromBytes(byte_array) | |
Detects and returns the information about a format of an excel stored in a byte array. | ||
static method | extensionToSaveFormat(extension) | |
Converts a file name extension into a SaveFormat value. | ||
static method | isTemplateFormat(extension) | |
Returns true if the extension is .xlt, .xltX, .xltm,.ots. | ||
static method | loadFormatToExtension(loadFormat) | |
Converts a load format enumerated value into a file extension. | ||
static method | loadFormatToSaveFormat(loadFormat) | |
Converts a LoadFormat value to a SaveFormat value if possible. | ||
static method | saveFormatToExtension(format) | |
Converts a save format enumerated value into a file extension. | ||
static method | saveFormatToLoadFormat(saveFormat) | |
Converts a SaveFormat value to a LoadFormat value if possible. |
Method Detail |
---|
detectFileFormat | |
static FileFormatInfo detectFileFormat(filePath) |
filePath: String
- The file path.detectFileFormat | |
static FileFormatInfo detectFileFormat(filePath, password) |
filePath: String
- The file path.password: String
- The password for encrypted ooxml files.detectFileFormat | |
static FileFormatInfo detectFileFormat(stream) |
stream: InputStream
- The streamextensionToSaveFormat | |
static int extensionToSaveFormat(extension) |
extension: String
- The file extension. Can be with or without a leading dot. Case-insensitive.isTemplateFormat | |
static boolean isTemplateFormat(extension) |
extension: String
- loadFormatToExtension | |
static String loadFormatToExtension(loadFormat) |
loadFormat: int
- A loadFormatToSaveFormat | |
static int loadFormatToSaveFormat(loadFormat) |
loadFormat: int
- A saveFormatToExtension | |
static String saveFormatToExtension(format) |
format: int
- A saveFormatToLoadFormat | |
static int saveFormatToLoadFormat(saveFormat) |
saveFormat: int
- A detectFileFormatFromBytes | |
static detectFileFormatFromBytes(byte_array) |
byte_array: bytes
- The byte arrayExample:
import jpype import asposecells jpype.startJVM() from asposecells.api import * with open('Book2.xlsx', 'rb') as f: result = FileFormatUtil.detectFileFormatFromBytes(f.read()) print("detect result: %d" %(result.getFileFormatType())) jpype.shutdownJVM()