Represents a floating
Layout which is used to embed
document element in a page outside of the main content flow.
Main content flow is usually wrapped around embedded element.
Inheritance Hierarchy Namespace: SautinSoft.Document.DrawingAssembly: SautinSoft.Document (in SautinSoft.Document.dll) Version: 2024.11.20
Syntax public sealed class FloatingLayout : Layout
Public NotInheritable Class FloatingLayout
Inherits Layout
The FloatingLayout type exposes the following members.
Constructors | Name | Description |
---|
| FloatingLayout |
Initializes a new instance of the FloatingLayout class
with the specified horizontal position, vertical position and size of a floating element.
|
TopProperties | Name | Description |
---|
| AllowOverlap |
Gets or sets a value that specifies whether floating element can overlap other elements.
|
| AspectRatioLocked |
Gets or sets a value indicating whether the shape's aspect ratio is locked.
|
| DistanceFromText |
Gets or sets the distance (in points) between the document text and the element.
|
| Effects |
Gets or sets a distance (in points) which shall be added to each edge of the element,
in order to compensate for any drawing effects applied to.
|
| HorizontalPosition |
Gets or sets the horizontal position.
|
| LayoutInCell |
When true, the floating element shall be positioned
within the existing table cell, causing the cell to be resized as needed.
|
| VerticalPosition |
Gets or sets the vertical position.
|
| WrappingStyle |
Gets or sets the setting for how text is wrapped around the floating element.
|
| WrapPolygon |
Gets or sets the wrapping polygon which shall be used to determine the extents to which text can
wrap around the floating element.
|
| WrapSide |
Gets or sets the setting for how text can wrap around the floating element's sides.
|
| ZOrder |
Gets or sets the z-order of the floating element.
|
TopExample See Developer Guide: This sample shows how to work with shapes
This sample shows how to work with shapes using C#
using SautinSoft.Document;
using SautinSoft.Document.Drawing;
namespace Sample
{
class Sample
{
static void Main(string[] args)
{
Shapes();
}
public static void Shapes()
{
string documentPath = @"Shapes.docx";
DocumentCore dc = new DocumentCore();
Shape shp1 = new Shape(dc, Layout.Floating(
new HorizontalPosition(25f, LengthUnit.Millimeter, HorizontalPositionAnchor.LeftMargin),
new VerticalPosition(20f, LengthUnit.Millimeter, VerticalPositionAnchor.TopMargin),
new Size(200, 100)
));
shp1.Outline.Fill.SetSolid(Color.DarkGreen);
shp1.Outline.Width = 2;
shp1.Fill.SetSolid(Color.Orange);
Shape shp2 = new Shape(dc, Layout.Floating(
new HorizontalPosition(100f, LengthUnit.Millimeter, HorizontalPositionAnchor.LeftMargin),
new VerticalPosition(20f, LengthUnit.Millimeter, VerticalPositionAnchor.TopMargin),
new Size(LengthUnitConverter.Convert(100f, LengthUnit.Millimeter, LengthUnit.Point),
LengthUnitConverter.Convert(20f, LengthUnit.Millimeter, LengthUnit.Point))
));
shp2.Outline.Fill.SetSolid(Color.LightGray);
shp2.Outline.Width = 0.5;
Paragraph p = new Paragraph(dc);
Run run1 = new Run(dc, "Welcome to International Software Developer conference!");
run1.CharacterFormat.FontName = "Helvetica";
run1.CharacterFormat.Size = 14f;
run1.CharacterFormat.Italic = true;
p.Inlines.Add(run1);
shp2.Text.Blocks.Add(p);
dc.Content.End.Insert(shp1.Content);
dc.Content.End.Insert(shp2.Content);
dc.Save(documentPath);
System.Diagnostics.Process.Start(new System.Diagnostics.ProcessStartInfo(documentPath) { UseShellExecute = true });
}
}
}
This sample shows how to work with shapes using VB.Net
Imports System
Imports System.IO
Imports SautinSoft.Document
Imports SautinSoft.Document.Drawing
Module Sample
Sub Main()
Shapes()
End Sub
Sub Shapes()
Dim documentPath As String = "Shapes.docx"
Dim dc As New DocumentCore()
Dim shp1 As New Shape(dc, Layout.Floating(New HorizontalPosition(25.0F, LengthUnit.Millimeter, HorizontalPositionAnchor.LeftMargin), New VerticalPosition(20.0F, LengthUnit.Millimeter, VerticalPositionAnchor.TopMargin), New Size(200, 100)))
shp1.Outline.Fill.SetSolid(Color.DarkGreen)
shp1.Outline.Width = 2
shp1.Fill.SetSolid(Color.Orange)
Dim shp2 As New Shape(dc, Layout.Floating(New HorizontalPosition(100.0F, LengthUnit.Millimeter, HorizontalPositionAnchor.LeftMargin), New VerticalPosition(20.0F, LengthUnit.Millimeter, VerticalPositionAnchor.TopMargin), New Size(LengthUnitConverter.Convert(100.0F, LengthUnit.Millimeter, LengthUnit.Point), LengthUnitConverter.Convert(20.0F, LengthUnit.Millimeter, LengthUnit.Point))))
shp2.Outline.Fill.SetSolid(Color.LightGray)
shp2.Outline.Width = 0.5
Dim p As New Paragraph(dc)
Dim run1 As New Run(dc, "Welcome to International Software Developer conference!")
run1.CharacterFormat.FontName = "Helvetica"
run1.CharacterFormat.Size = 14.0F
run1.CharacterFormat.Italic = True
p.Inlines.Add(run1)
shp2.Text.Blocks.Add(p)
dc.Content.End.Insert(shp1.Content)
dc.Content.End.Insert(shp2.Content)
dc.Save(documentPath)
System.Diagnostics.Process.Start(New System.Diagnostics.ProcessStartInfo(documentPath) With {.UseShellExecute = True})
End Sub
End Module
See Also