FrameFormat Class
Represents frame related formatting for a paragraph.
Inheritance Hierarchy
SystemObject
  Aspose.WordsFrameFormat

Namespace: Aspose.Words
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.11
Syntax
public class FrameFormat

The FrameFormat type exposes the following members.

Properties
  NameDescription
Public propertyCode exampleHeight
Gets the height of the specified frame.
Public propertyCode exampleHeightRule
Gets the rule for determining the height of the specified frame.
Public propertyCode exampleHorizontalAlignment
Gets horizontal alignment of the specified frame.
Public propertyCode exampleHorizontalDistanceFromText
Gets horizontal distance between a frame and the surrounding text, in points.
Public propertyCode exampleHorizontalPosition
Gets horizontal distance between the edge of the frame and the item specified by the RelativeHorizontalPosition property.
Public propertyCode exampleIsFrame
Returns true if the paragraph is a frame.
Public propertyCode exampleRelativeHorizontalPosition
Gets the relative horizontal position of a frame.
Public propertyCode exampleRelativeVerticalPosition
Gets the relative vertical position of a frame.
Public propertyCode exampleVerticalAlignment
Gets vertical alignment of the specified frame.
Public propertyCode exampleVerticalDistanceFromText
Specifies vertical distance (in points) between a frame and the surrounding text.
Public propertyCode exampleVerticalPosition
Gets vertical distance between the edge of the frame and the item specified by the RelativeVerticalPosition property.
Public propertyCode exampleWidth
Gets the width of the specified frame, in points.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Remarks

This object is always created. If a paragraph is a frame, then all properties will contain respective values, otherwise all properties are set to their defaults.

Use IsFrame to check whether paragraph is a frame.

Examples
Shows how to get information about formatting properties of paragraph as frame.
Document doc = new Document(MyDir + "Paragraph.Frame.docx");

ParagraphCollection paragraphs = doc.FirstSection.Body.Paragraphs;

foreach (Paragraph paragraph in paragraphs.OfType<Paragraph>())
{
    if (paragraph.FrameFormat.IsFrame)
    {
        Console.WriteLine("Width: " + paragraph.FrameFormat.Width);
        Console.WriteLine("Height: " + paragraph.FrameFormat.Height);
        Console.WriteLine("HeightRule: " + paragraph.FrameFormat.HeightRule);
        Console.WriteLine("HorizontalAlignment: " + paragraph.FrameFormat.HorizontalAlignment);
        Console.WriteLine("VerticalAlignment: " + paragraph.FrameFormat.VerticalAlignment);
        Console.WriteLine("HorizontalPosition: " + paragraph.FrameFormat.HorizontalPosition);
        Console.WriteLine("RelativeHorizontalPosition: " +
                          paragraph.FrameFormat.RelativeHorizontalPosition);
        Console.WriteLine("HorizontalDistanceFromText: " +
                          paragraph.FrameFormat.HorizontalDistanceFromText);
        Console.WriteLine("VerticalPosition: " + paragraph.FrameFormat.VerticalPosition);
        Console.WriteLine("RelativeVerticalPosition: " + paragraph.FrameFormat.RelativeVerticalPosition);
        Console.WriteLine("VerticalDistanceFromText: " + paragraph.FrameFormat.VerticalDistanceFromText);
    }
}
See Also