Page setup

The paper size, orientation, font, and other layout settings are configured through GlobalPageSettings object. It also allows you to provide paths to images used in the form. GlobalPageSettings object is passed as an optional parameter to the template generation methods.

Page setup

You can customize the following page layout parameters through GlobalPageSettings:

  • PaperSize - page sizes and dimensions. Default: A4 (210 x 297 mm).
  • Orientation - page orientation. Default: portrait (vertical).
  • PageMarginLeft and PageMarginRight - left and right margins of the page, in pixels.
  • FontFamily - default font family for all texts, except for those directly overridden in the source code. For example, "Courier New".
  • FontSize - default font size for all texts, except for those directly overridden in the source code.
  • FontStyle - default font style for all texts, except for those directly overridden in the source code.
  • BubbleSize - default size of answer bubbles, except for those directly overridden in the source code.
  • BubbleColor - color of all bubbles. Default: black.
  • Wrap - wrapping mode:
    • Aspose.OMR.Generation.WrappingPolicy.None - disable column wrapping (default);
    • Aspose.OMR.Generation.WrappingPolicy.Column - enable automatic column wrapping.
  • RotationPointPosition - the placement of the rectangular positioning marker that is used to detect the page orientation. See details below.

Image paths

The GlobalPageSettings object is also used to provide the full path to each image mentioned in the source code. The paths are provided as an array of strings using ImagesPaths property.

Read more info in this article.

Positioning marker placement

The RotationPointPosition property controls the placement of the rectangular positioning marker that is used to detect the page orientation. It is provided one of the following values of Aspose.OMR.Generation.RotationPointPosition enumerator:

Enumeration Value Result
TopLeft1 10 Below the top-left square positioning marker
TopLeft2 11 To the right of the top-left square positioning marker
TopRight1 20 Below the top-right square positioning marker
TopRight2 21 To the left of the top-left square positioning marker
BottomLeft1 30 Above the bottom-left square positioning marker
BottomLeft2 31 To the right of the bottom-left square positioning marker
BottomRight1 40 Above the bottom-right square positioning marker
BottomRight2 41 To the left of the bottom-right square positioning marker

Example

Aspose.OMR.Generation.GlobalPageSettings globalPageSettings = new Aspose.OMR.Generation.GlobalPageSettings() {
	PaperSize = Aspose.OMR.Generation.PaperSize.Tabloid,
	Orientation = Aspose.OMR.Generation.Orientation.Horizontal,
	BubbleColor= Aspose.OMR.Generation.Color.Red,
	ImagesPaths = new string[] {
		@"c:\images\aspose-logo.png",
		@"c:\images\vignette.png"
	}
};