Xamarin.Android

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class WrapFormat

    Show / Hide Table of Contents

    Class WrapFormat

    Represents the functions that specify how text wraps around the object in the Word document.

    Inheritance
    System.Object
    WrapFormat
    Namespace: Syncfusion.DocIO.DLS
    Assembly: Syncfusion.DocIO.Portable.dll
    Syntax
    public class WrapFormat : Object
    Examples
    private void Button1_Click(System.Object sender, System.EventArgs e)
    {
        //Create a new Word document 
        WordDocument document = new WordDocument();
        //Add new section to the document
        IWSection section = document.AddSection();
        //Add new paragraph to the section
        WParagraph paragraph = section.AddParagraph() as WParagraph;
        paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet");
        //Add new shape to the document
        Shape rectangle = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100);
        //Set position for shape
        rectangle.VerticalPosition = 72;
        rectangle.HorizontalPosition = 72;
        //Set text wrapping style
        rectangle.WrapFormat.TextWrappingStyle = TextWrappingStyle.TopAndBottom;
        rectangle.WrapFormat.DistanceBottom = 10;
        rectangle.WrapFormat.DistanceLeft = 10;
        rectangle.WrapFormat.DistanceRight = 10;
        rectangle.WrapFormat.DistanceTop = 20;
        paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet");
        //Save and close the document
        document.Save("Sample.docx", FormatType.Docx);
        document.Close();
    }
    Private Sub button_Click(sender As Object, e As EventArgs)
        'Create a new Word document 
        Dim document As New WordDocument()
        'Add new section to the document
        Dim section As IWSection = document.AddSection()
        'Add new paragraph to the section
        Dim paragraph As WParagraph = TryCast(section.AddParagraph(), WParagraph)
        paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet")
        'Add new shape to the document
        Dim rectangle As Shape = paragraph.AppendShape(AutoShapeType.RoundedRectangle, 150, 100)
        'Set position for shape
        rectangle.VerticalPosition = 72
        rectangle.HorizontalPosition = 72
        'Set text wrapping style
        rectangle.WrapFormat.TextWrappingStyle = TextWrappingStyle.TopAndBottom
        rectangle.WrapFormat.DistanceBottom = 10
        rectangle.WrapFormat.DistanceLeft = 10
        rectangle.WrapFormat.DistanceRight = 10
        rectangle.WrapFormat.DistanceTop = 20
        paragraph.AppendText("Lorem ipsum dolor sit amet, lacus amet amet ultricies. Quisque mi venenatis morbi libero, orci dis, mi ut et class porta, massa ligula magna enim, aliquam orci vestibulum Turpis facilisis vitae consequat, cum a a,turpis dui consequat massa in dolor per, felis non amet")
        'Save and close the document
        document.Save("Sample.docx", FormatType.Docx)
        document.Close()
    End Sub

    Constructors

    WrapFormat()

    Declaration
    public WrapFormat()

    Properties

    AllowOverlap

    Gets or sets a value indicating whether a given shape can overlap other shapes.

    Declaration
    public bool AllowOverlap { get; set; }
    Property Value
    Type Description
    System.Boolean

    DistanceBottom

    Gets or sets the distance (in points) between the document text and the bottom edge of the text-free area surrounding the specified shape.

    Declaration
    public float DistanceBottom { get; set; }
    Property Value
    Type Description
    System.Single

    The float that specifies the distance between text and bottom edge of the shape.

    DistanceLeft

    Gets or sets the distance (in points) between the document text and the left edge of the text-free area surrounding the specified shape.

    Declaration
    public float DistanceLeft { get; set; }
    Property Value
    Type Description
    System.Single

    The float that specifies the distance between text and left edge of the shape.

    DistanceRight

    Gets or sets the distance (in points) between the document text and the right edge of the text-free area surrounding the specified shape.

    Declaration
    public float DistanceRight { get; set; }
    Property Value
    Type Description
    System.Single

    The float that specifies the distance between text and right edge of the shape.

    DistanceTop

    Gets or sets the distance (in points) between the document text and the top edge of the text-free area surrounding the specified shape.

    Declaration
    public float DistanceTop { get; set; }
    Property Value
    Type Description
    System.Single

    The float that specifies the distance between text and top edge of the shape.

    TextWrappingStyle

    Gets or sets the text wrapping style for the specified shape.

    Declaration
    public TextWrappingStyle TextWrappingStyle { get; set; }
    Property Value
    Type Description
    TextWrappingStyle

    The TextWrappingStyle member that specifies the text wrapping style.

    TextWrappingType

    Gets or sets the text wrapping type for the specified shape.

    Declaration
    public TextWrappingType TextWrappingType { get; set; }
    Property Value
    Type Description
    TextWrappingType

    The TextWrappingType member that specifies the wrapping type.

    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved