com.aspose.words

Class FrameFormat

  • java.lang.Object
    • com.aspose.words.FrameFormat
public class FrameFormat 
extends java.lang.Object

Represents frame related formatting for a paragraph.

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.

Example:

Shows how to get information about formatting properties of paragraphs that are frames.
Document doc = new Document(getMyDir() + "Paragraph frame.docx");

ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();

for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
    if (paragraph.getFrameFormat().isFrame()) {
        System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
        System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
        System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
        System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
        System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
        System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
        System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
        System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
        System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
        System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
        System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
    }
}

Property Getters/Setters Summary
doublegetHeight()
Gets the height of the specified frame.
intgetHeightRule()
Gets the rule for determining the height of the specified frame. The value of the property is HeightRule integer constant.
intgetHorizontalAlignment()
Gets horizontal alignment of the specified frame. The value of the property is HorizontalAlignment integer constant.
doublegetHorizontalDistanceFromText()
Gets horizontal distance between a frame and the surrounding text, in points.
doublegetHorizontalPosition()
Gets horizontal distance between the edge of the frame and the item specified by the RelativeHorizontalPosition property.
booleanisFrame()
Returns true if the paragraph is a frame.
intgetRelativeHorizontalPosition()
Gets the relative horizontal position of a frame. The value of the property is RelativeHorizontalPosition integer constant.
intgetRelativeVerticalPosition()
Gets the relative vertical position of a frame. The value of the property is RelativeVerticalPosition integer constant.
intgetVerticalAlignment()
Gets vertical alignment of the specified frame. The value of the property is VerticalAlignment integer constant.
doublegetVerticalDistanceFromText()
Specifies vertical distance (in points) between a frame and the surrounding text.
doublegetVerticalPosition()
Gets vertical distance between the edge of the frame and the item specified by the RelativeVerticalPosition property.
doublegetWidth()
Gets the width of the specified frame, in points.
 

    • Property Getters/Setters Detail

      • getHeight

        public double getHeight()
        
        Gets the height of the specified frame.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getHeightRule

        public int getHeightRule()
        
        Gets the rule for determining the height of the specified frame. The value of the property is HeightRule integer constant.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getHorizontalAlignment

        public int getHorizontalAlignment()
        
        Gets horizontal alignment of the specified frame. The value of the property is HorizontalAlignment integer constant.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getHorizontalDistanceFromText

        public double getHorizontalDistanceFromText()
        
        Gets horizontal distance between a frame and the surrounding text, in points.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getHorizontalPosition

        public double getHorizontalPosition()
        
        Gets horizontal distance between the edge of the frame and the item specified by the RelativeHorizontalPosition property.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • isFrame

        public boolean isFrame()
        
        Returns true if the paragraph is a frame.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getRelativeHorizontalPosition

        public int getRelativeHorizontalPosition()
        
        Gets the relative horizontal position of a frame. The value of the property is RelativeHorizontalPosition integer constant.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getRelativeVerticalPosition

        public int getRelativeVerticalPosition()
        
        Gets the relative vertical position of a frame. The value of the property is RelativeVerticalPosition integer constant.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getVerticalAlignment

        public int getVerticalAlignment()
        
        Gets vertical alignment of the specified frame. The value of the property is VerticalAlignment integer constant.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getVerticalDistanceFromText

        public double getVerticalDistanceFromText()
        
        Specifies vertical distance (in points) between a frame and the surrounding text.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getVerticalPosition

        public double getVerticalPosition()
        
        Gets vertical distance between the edge of the frame and the item specified by the RelativeVerticalPosition property.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }
      • getWidth

        public double getWidth()
        
        Gets the width of the specified frame, in points.

        Example:

        Shows how to get information about formatting properties of paragraphs that are frames.
        Document doc = new Document(getMyDir() + "Paragraph frame.docx");
        
        ParagraphCollection paragraphs = doc.getFirstSection().getBody().getParagraphs();
        
        for (Paragraph paragraph : (Iterable<Paragraph>) paragraphs) {
            if (paragraph.getFrameFormat().isFrame()) {
                System.out.println("Width: " + paragraph.getFrameFormat().getWidth());
                System.out.println("Height: " + paragraph.getFrameFormat().getHeight());
                System.out.println("HeightRule: " + paragraph.getFrameFormat().getHeightRule());
                System.out.println("HorizontalAlignment: " + paragraph.getFrameFormat().getHorizontalAlignment());
                System.out.println("VerticalAlignment: " + paragraph.getFrameFormat().getVerticalAlignment());
                System.out.println("HorizontalPosition: " + paragraph.getFrameFormat().getHorizontalPosition());
                System.out.println("RelativeHorizontalPosition: " + paragraph.getFrameFormat().getRelativeHorizontalPosition());
                System.out.println("HorizontalDistanceFromText: " + paragraph.getFrameFormat().getHorizontalDistanceFromText());
                System.out.println("VerticalPosition: " + paragraph.getFrameFormat().getVerticalPosition());
                System.out.println("RelativeVerticalPosition: " + paragraph.getFrameFormat().getRelativeVerticalPosition());
                System.out.println("VerticalDistanceFromText: " + paragraph.getFrameFormat().getVerticalDistanceFromText());
            }
        }