GemBox.Document
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    Layout Class

    Namespace:
    GemBox.Document
    Assembly:
    GemBox.Document.dll

    Represents a base class for specifying element's layout properties, such as position and size.

    • C#
    • VB.NET
    public abstract class Layout
    Public MustInherit Class Layout
    Inheritance:
    System.Object
    Layout
    Derived
    FloatingLayout
    InlineLayout
    Remarks

    DrawingElement (Picture, TextBox or Shape) can be embedded / positioned (by using Layout property):

    • In line with the text (InlineLayout type) - affects the line height and layout of its line (like a character glyph of similar size).
    • Floating within the text relative to the page (FloatingLayout type) - affects the layout of its surrounding content which is either wrapped around or in-front / behind the floating element.

    Besides position, embeddable element must also have size specified. DrawingElement's position and size are contained in Layout property.

    Embedded element's layout can be specified by either instantiating appropriate Layout derived type, such as InlineLayout or FloatingLayout, or by using factory methods Inline(Double, Double, LengthUnit) or Floating(HorizontalPosition, VerticalPosition, Size).

    For more information, seeShapes and Layoutarticle.

    Properties

    EffectPadding

    Gets or sets the additional padding added to each edge of the element (top, bottom, left, right) in order to compensate for any drawing effects applied to the element.

    • C#
    • VB.NET
    public Padding EffectPadding { get; set; }
    Public Property EffectPadding As Padding
    Property Value
    Padding

    The additional padding added to each edge of the element (top, bottom, left, right) in order to compensate for any drawing effects applied to the element.

    Remarks

    EffectPadding is currently not supported when exporting a document to PDF, XPS, or image formats.

    IsFloating

    Gets a value indicating whether element which has this Layout instance applied is floating around page main content.

    • C#
    • VB.NET
    public abstract bool IsFloating { get; }
    Public MustOverride ReadOnly Property IsFloating As Boolean
    Property Value
    System.Boolean

    true if element which has this Layout instance applied is floating around page main content; otherwise, false.

    Remarks

    DrawingElement (Picture, TextBox or Shape) can be embedded / positioned (by using Layout property):

    • In line with the text (InlineLayout type) - affects the line height and layout of its line (like a character glyph of similar size).
    • Floating within the text relative to the page (FloatingLayout type) - affects the layout of its surrounding content which is either wrapped around or in-front / behind the floating element.

    Besides position, embeddable element must also have size specified. DrawingElement's position and size are contained in Layout property.

    Embedded element's layout can be specified by either instantiating appropriate Layout derived type, such as InlineLayout or FloatingLayout, or by using factory methods Inline(Double, Double, LengthUnit) or Floating(HorizontalPosition, VerticalPosition, Size).

    For more information, seeShapes and Layoutarticle.

    LockAspectRatio

    Gets or sets the value indicating whether the aspect ratio is locked.

    • C#
    • VB.NET
    public bool LockAspectRatio { get; set; }
    Public Property LockAspectRatio As Boolean
    Property Value
    System.Boolean

    true if aspect ratio is locked; otherwise, false.

    Remarks

    Default value of this property is false.

    Size

    Gets or sets the size.

    • C#
    • VB.NET
    public Size Size { get; set; }
    Public Property Size As Size
    Property Value
    Size

    The size.

    Transform

    Gets or sets the transformation.

    • C#
    • VB.NET
    public Transform Transform { get; set; }
    Public Property Transform As Transform
    Property Value
    Transform

    The transformation.

    Methods

    Floating(HorizontalPosition, VerticalPosition, Size)

    Creates a layout used when element should be floating in a document page and rest of the page content should wrap around it.

    • C#
    • VB.NET
    public static FloatingLayout Floating(HorizontalPosition horizontalPosition, VerticalPosition verticalPosition, Size size)
    Public Shared Function Floating(horizontalPosition As HorizontalPosition, verticalPosition As VerticalPosition, size As Size) As FloatingLayout
    Parameters
    horizontalPosition
    HorizontalPosition

    The horizontal position of a floating element.

    verticalPosition
    VerticalPosition

    The vertical position of a floating element.

    size
    Size

    The size of a floating element.

    Returns
    FloatingLayout

    A new instance of a FloatingLayout type which contains all floating element's layout-related properties.

    Inline(Size)

    Creates a layout used when element should be embedded in-line with the rest of the content.

    • C#
    • VB.NET
    public static InlineLayout Inline(Size size)
    Public Shared Function Inline(size As Size) As InlineLayout
    Parameters
    size
    Size

    The size of the embedded element.

    Returns
    InlineLayout

    A new instance of an InlineLayout type which contains all in-line embedded element's layout-related properties.

    Inline(Double, Double, LengthUnit)

    Creates a layout used when element should be embedded in-line with the rest of the content.

    • C#
    • VB.NET
    public static InlineLayout Inline(double width, double height, LengthUnit unit)
    Public Shared Function Inline(width As Double, height As Double, unit As LengthUnit) As InlineLayout
    Parameters
    width
    System.Double

    The width of the embedded element.

    height
    System.Double

    The height of the embedded element.

    unit
    LengthUnit

    The measurement unit used for width and height.

    Returns
    InlineLayout

    A new instance of an InlineLayout type which contains all in-line embedded element's layout-related properties.

    Examples

    Shapes example
    Text Boxes example
    Pictures example
    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.