public class FrameFormat
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 Example:
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 | ||
---|---|---|
double | getHeight() | |
Gets the height of the specified frame.
|
||
int | getHeightRule() | |
Gets the rule for determining the height of the specified frame.
The value of the property is HeightRule integer constant. |
||
int | getHorizontalAlignment() | |
Gets horizontal alignment of the specified frame.
The value of the property is HorizontalAlignment integer constant. |
||
double | getHorizontalDistanceFromText() | |
Gets horizontal distance between a frame and the surrounding text, in points.
|
||
double | getHorizontalPosition() | |
Gets horizontal distance between the edge of the frame and the item specified by the |
||
boolean | isFrame() | |
Returns true if the paragraph is a frame.
|
||
int | getRelativeHorizontalPosition() | |
Gets the relative horizontal position of a frame.
The value of the property is RelativeHorizontalPosition integer constant. |
||
int | getRelativeVerticalPosition() | |
Gets the relative vertical position of a frame.
The value of the property is RelativeVerticalPosition integer constant. |
||
int | getVerticalAlignment() | |
Gets vertical alignment of the specified frame.
The value of the property is VerticalAlignment integer constant. |
||
double | getVerticalDistanceFromText() | |
Specifies vertical distance (in points) between a frame and the surrounding text.
|
||
double | getVerticalPosition() | |
Gets vertical distance between the edge of the frame and the item specified by the |
||
double | getWidth() | |
Gets the width of the specified frame, in points.
|
public double getHeight()
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()); } }
public int getHeightRule()
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()); } }
public int getHorizontalAlignment()
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()); } }
public double getHorizontalDistanceFromText()
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()); } }
public double getHorizontalPosition()
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()); } }
public boolean isFrame()
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()); } }
public int getRelativeHorizontalPosition()
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()); } }
public int getRelativeVerticalPosition()
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()); } }
public int getVerticalAlignment()
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()); } }
public double getVerticalDistanceFromText()
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()); } }
public double getVerticalPosition()
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()); } }
public double getWidth()
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()); } }