Page setup
Contents
[
Hide
]
The paper size, orientation, font, and other layout settings are configured through GlobalPageSettings
structure. It also allows you to provide paths to images used in the form. GlobalPageSettings
is passed as an optional parameter to the template generation function.
Page setup
You can customize the following page layout parameters through GlobalPageSettings
:
Setting | Type | Default value | Description |
---|---|---|---|
PaperSize |
PaperSize |
A4 (210 x 297 mm) | Physical page dimensions. |
Orientation |
Orientation |
Portrait (vertical) | Page orientation - horizontal (landscape) or vertical (portrait). |
PageMarginLeft |
int |
210 pixels | The size of the left page margin in pixels. |
PageMarginLeft |
int |
210 pixels | The size of the right page margin in pixels. |
FontFamily |
string |
Default system font | Font family for all texts, except for those directly overridden in the source code. For example, "Courier New" .The selected font must be installed on the system that generates the printable form! Otherwise, form generation will fail with an exception. |
FontSize |
int |
12 | Font size for all texts, except for those directly overridden in the form’s source code. |
FontStyle |
FontStyle |
Regular | Font style for all texts, except for those directly overridden in the source code. See the full list of supported font styles below. |
BubbleSize |
BubbleSize |
Normal | Size of answer bubbles, except for those directly overridden in the source code. See the full list of supported bubble sizes below. |
BubbleColor |
DrawingColor |
Black | Color of all answer bubbles in the form. See the full list of supported colors. |
ImagesPaths |
string[] |
n/a | Full path to each image mentioned in the form’s source code. |
Supported paper sizes
The PaperSize
property controls the paper size of the generated form. All form elements will be re-aligned to best match the selected paper size.
Enumeration | Page dimensions (pixels) | Page dimensions (mm) | Page dimensions (inches) |
---|---|---|---|
PaperSize.A4 |
2480 x 3508 | 210 x 297 | 8.3 x 11.7 |
PaperSize.Legal |
2551 x 4205 | 215.9 x 355.6 | 8.5 x 14 |
PaperSize.Letter |
2551 x 3295 | 215.9 x 279.4 | 8.5 x 11 |
PaperSize.p8519 |
2551 x 5702 | 215.9 x 482.6 | 8.5 x 19 |
PaperSize.p8521 |
2551 x 6302 | 215.9 x 533.4 | 8.5 x 21 |
PaperSize.Tabloid |
3295 x 5102 | 279 x 432 | 11 x 17 |
The selected paper size does not affect the size of bubbles, images or fonts. Changing the paper size only affects the positioning of elements on the page.
Supported font styles
You can use the following font styles for form texts:
Enumeration | Font face |
---|---|
FontStyle.Regular |
Normal |
FontStyle.Bold |
Bold / strong |
FontStyle.Italic |
Italic / oblique |
FontStyle.Underline |
Underlined |
FontStyle.Strikeout |
Supported bubble sizes
Possible sizes of answer bubbles:
Value | Bubble size |
---|---|
BubbleSize.Extrasmall |
40 pixels |
BubbleSize.Small |
50 pixels |
BubbleSize.Normal |
60 pixels |
BubbleSize.Large |
80 pixels |
BubbleSize.Extralarge |
100 pixels |
Example
System::SharedPtr<Api::OmrEngine> engine = System::MakeObject<Api::OmrEngine>();
// Generate the form for ANSI Letter paper size (8.5 by 11 inches)
System::SharedPtr<Api::GlobalPageSettings> settings = System::MakeObject<Api::GlobalPageSettings>();
settings->setPaperSize(Api::PaperSize::Letter);
System::SharedPtr<Generation::GenerationResult> result = engine->GenerateTemplate(markupPath, nullptr, settings);