Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
This Gist repository contains code snippet related to Aspose.OMR Cloud SDK for Node.js
Aspose.OMR-Cloud-SDK-Node.js
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-nodejs/
correctTemplate(templateFilePath, imageFilePath) {
return this.storage.uploadFile(imageFilePath, "")
.then(() => {
let imageName = path.basename(imageFilePath);
let param = new api.OMRFunctionParam();
param.functionParam = this.serializeFiles([templateFilePath]);
return this.omrApi.postRunOmrTask(imageName, "CorrectTemplate", param);
});
}
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-nodejs/
finalizeTemplate(templateId, correctedTemplateFilePath) {
return this.storage.uploadFile(correctedTemplateFilePath, "")
.then(() => {
let correctedTemplateFileName = path.basename(correctedTemplateFilePath);
let param = new api.OMRFunctionParam();
param.functionParam = templateId;
return this.omrApi.postRunOmrTask(correctedTemplateFileName, "FinalizeTemplate", param);
});
}
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-nodejs/
generateTemplate(templateFilePath) {
return this.storage.uploadFile(templateFilePath, "")
.then(() => {
let templateName = path.basename(templateFilePath);
let param = new api.OMRFunctionParam();
param.functionParam = JSON.stringify({"ExtraStoragePath" : this.logosFolderName});
return this.omrApi.postRunOmrTask(templateName, "GenerateTemplate", param);
});
}
// For complete examples and data files, please go to https://github.com/aspose-omr-cloud/aspose-omr-cloud-nodejs/
recognizeImage(templateId, imagePath) {
return this.storage.uploadFile(imagePath, "")
.then(() => {
let imageFileName = path.basename(imagePath);
let param = new api.OMRFunctionParam();
param.functionParam = templateId;
return this.omrApi.postRunOmrTask(imageFileName, "RecognizeImage", param);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment