I am trying to create an answer sheet using the on premise .NET application for the OMR service. I have managed to get some elements rendered using the documentation. However, I can’t find any documentation for the CustomRowConfig
element. I want to create a template like the once described in custom_answer_sheet
section of the TEXT Markup
documentation (linked here)
The code that I have at the moment is as follows:
using Aspose.OMR.Generation;
using Aspose.OMR.Generation.Config;
using Aspose.OMR.Generation.Config.Elements;
using Aspose.OMR.Generation.Config.Elements.CustomAnswerSheet;
using Aspose.OMR.Generation.Config.Elements.Parents;
using Aspose.OMR.Generation.Config.Elements.ScoreGroup;
using Aspose.OMR.Generation.Config.Elements.Table;
using Aspose.OMR.Generation.Config.Enums;
namespace HelloOMR
{
internal class Program
{
static void Main(string[] args)
{
Aspose.OMR.License omrLicense = new Aspose.OMR.License();
omrLicense.SetLicense("pathToLicense");
Aspose.OMR.Api.OmrEngine omrEngine = new Aspose.OMR.Api.OmrEngine();
Aspose.OMR.Generation.GlobalPageSettings globalPageSettings = new Aspose.OMR.Generation.GlobalPageSettings() {
PaperSize = Aspose.OMR.Generation.PaperSize.Legal,
Orientation = Aspose.OMR.Generation.Orientation.Horizontal,
ImagesPaths = new string[] {
@"pathToImage1",
@"pathToImage2",
@"pathToImage3"
}
};
Aspose.OMR.Generation.Config.TemplateConfig templateConfig = new Aspose.OMR.Generation.Config.TemplateConfig() {
Children=new List<BaseConfig>() {
new PageConfig() {
Children = new List<BaseConfig>() {
new ContainerConfig(){
Name = "Logo container",
ColumnsCount = 3,
Children = new List<BaseConfig>(){
new BlockConfig(){
Column = 1,
Children = new List<BaseConfig>(){
new ImageConfig() {
Name = "logo1.png",
Height=400,
XPosition=900,
YPosition=12,
Width=400,
ImageAlign = AlignmentEnum.Left
},
}
},
new BlockConfig(){
Column = 2,
Children = new List<BaseConfig>(){
new ImageConfig() {
Name = "logo2.png",
Height=400,
XPosition=1900,
YPosition=12,
Width=400,
ImageAlign = AlignmentEnum.Left
},
}
},
new BlockConfig(){
Column = 3,
Children = new List<BaseConfig>(){
new ImageConfig() {
Name = "logo3.png",
Height=400,
XPosition=2900,
YPosition=12,
Width=600,
ImageAlign = AlignmentEnum.Left
},
}
}
}
},
new CustomAnswerSheetConfig(){
Amount = 2,
ColumnsCount = 1,
Proportions = new List<int>{7, 93},
Children = new List<BaseConfig>(){
new CustomRowConfig(){
Name = "Row1",
Children = new List<BaseConfig>(){
new ContentConfig(){
Name = "Test"
},
new BubbleArrayConfig(){
FontSize = 5,
AnswersValues = {"X", "X", "X", "X", "X"},
BubbleSize = BubbleSize.Extrasmall
}
}
}
}
},
}
}
}
};
Aspose.OMR.Generation.GenerationResult generationResult = omrEngine.GenerateTemplate(templateConfig, globalPageSettings);
generationResult.Save("", "Hello.OMR");
}
}
}
In this code you can see, I am trying to use the CustomAnswerSheetConfig and the CustomRowConfig. Although, if I run this code as it is now I get the following error
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
and this is thrown at the following line Aspose.OMR.Generation.Config.TemplateConfig templateConfig = new Aspose.OMR.Generation.Config.TemplateConfig() {
Where can I find the correct documentation to use these elements?