I am trying to use the .NET application to generate an answer sheet. However, when I type in a value for elements_count
it always renders 10 elements (regardless of the entered value being less than or greater than 10). I face the same error when using the text markup. However, when using the GUI client this error does not occur (I want to be able to use the .NET application as it allows for more customization of the sheet)
Here is the code for the sheet generation
Aspose.OMR.Generation.Config.TemplateConfig tempConfig = new Aspose.OMR.Generation.Config.TemplateConfig() {
Children=new List<BaseConfig>(){
new PageConfig() {
Children=new List<BaseConfig>(){
new TextConfig(){
Name="Player One",
FontSize=12,
FontStyle=FontStyle.Bold
},
new EmptyLineConfig(),
new AnswerSheetConfig(){
Name="One",
ElementsCount=20,
ColumnsCount=1,
AnswersCount=1,
BubbleSize=BubbleSize.Extrasmall,
VerticalMargin=2,
AnswersValues=new string[] {"1", "2", "3", "4", "5"}
}
}
}
}
};
@Manawat27
Can you please share a working code along with the output template? It will help us investigate and guide you accordingly.
using Aspose.OMR.Generation;
using Aspose.OMR.Generation.Config;
using Aspose.OMR.Generation.Config.Elements;
using Aspose.OMR.Generation.Config.Elements.Parents;
namespace HelloOMR
{
internal class Program
{
static void Main(string[] args)
{
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
};
// Aspose.OMR.Generation.GenerationResult generationResult = omrEngine.GenerateTemplate("C:\\Users\\vmanawat\\Desktop\\test\\OMR\\template.txt", globalPageSettings);
// generationResult.Save("", "Hello.OMR");
Aspose.OMR.Generation.Config.TemplateConfig templateConfig = new Aspose.OMR.Generation.Config.TemplateConfig() {
Children=new List<BaseConfig>() {
new PageConfig() {
Children = new List<BaseConfig>() {
new TextConfig() {
Name = "Biology Quiz",
FontSize = 16,
FontStyle = FontStyle.Bold
},
new EmptyLineConfig(),
new AnswerSheetConfig() {
Name = "Plants",
ElementsCount = 15,
ColumnsCount = 1,
AnswersCount = 26,
BubbleSize = BubbleSize.Extrasmall,
VerticalMargin = 10,
AnswersValues = new string[] { "X" }
}
}
}
}
};
Aspose.OMR.Generation.GenerationResult generationResult = omrEngine.GenerateTemplate(templateConfig, globalPageSettings);
generationResult.Save("", "Hello.OMR");
}
}
}
This is the entire working code. The result of this is also attached to the reply - what I expect is 15 questions instead of just 10. I get 10 questions rendered even if I set the elements_count=2
Additionally, I want to be able to use the custom_answer_sheet functionality in the .NET application but I don’t see any documentation on doing so (custom_answer_sheet|Documentation this is the documentation from the text_markup)
test.jpg (116.4 KB)
@Manawat27
Thanks for the sample code and output. We are looking into the issue and will update you accordingly.
@Manawat27
We have investigated and noticed that you are using the on premise API(Aspose.OMR for .NET) instead of the cloud API, and it seems you are evaluating the OMR application without a valid license. To get started, you can get a free temporary license and if you face any problems in the process, write to the Aspose.OMR for .NET forum.