Generating the template

Contents
[ ]

To generate a form image that can be printed out and handled to respondents, process the form’s source code with GenerateTemplate method.

System::SharedPtr<Api::OmrEngine> engine = System::MakeObject<Api::OmrEngine>();
System::SharedPtr<Generation::GenerationResult> result = engine->GenerateTemplate(u"source.txt");

It will create a printable form for A4 (210 x 297 mm) paper in portrait (vertical) orientation using the default font and colors. You can customize the paper size, orientation, font, colors and other layout settings that apply to all template pages, as well as specify paths to images used in the form by passing GlobalPageSettings object to the method.

If your form contains images, pass the absolute path to each image file in a string array:

const char* images[1] = {
	u"aspose-logo.png"
};
System::SharedPtr<Api::OmrEngine> engine = System::MakeObject<Api::OmrEngine>();
System::SharedPtr<Generation::GenerationResult> result = engine->GenerateTemplate(u"source.txt", images);

Read more

  • Page setup - customizing the paper size, orientation, font, images, and other layout settings of a printable form.
  • Saving to file - saving a generated printable form and a recognition pattern file on disk.