Aspose.OCR.Examples.CSharp.FormattingAndManipulatingOMR.DynamicallyCreateOMRTemplates.Run C# (CSharp) Method

Run() public static method

public static Run ( ) : void
return void
        public static void Run()
        {
            // ExStart:DynamicallyCreateOMRTemplates
            // The path to the documents directory.
            string dataDir = RunExamples.GetDataDir_OMR();
            OmrTemplate template = new OmrTemplate();
            OmrPage page = template.Pages[0];
            page.Width = 215.9;
            page.Height = 279.4;
            PointF choiceBoxPosition = new PointF(20, 5); // 20 mm to the right, 5 mm from the top
            SizeF choiceBoxSize = new SizeF(12, 24);
            ChoiceBoxElement choiceBox = new ChoiceBoxElement("AnotherElement", choiceBoxPosition, choiceBoxSize);
            choiceBox.IsHorizontal = false;
            choiceBox.Cells.Add(new OmrCell("A")); // Three marks: (A) (B) (C)
            choiceBox.Cells.Add(new OmrCell("B"));
            choiceBox.Cells.Add(new OmrCell("C"));
            page.Elements.Add(choiceBox);
            template.Save(dataDir + "New_template_out.amr");
            // ExEnd:DynamicallyCreateOMRTemplates
        }
    }
DynamicallyCreateOMRTemplates