Frame positioning and formatting options
XmlComponent representing the frame properties element
// Frame with absolute positioning
createFrameProperties({
type: "absolute",
position: { x: 1440, y: 1440 }, // 1 inch from anchor
width: 2880, // 2 inches
height: 1440, // 1 inch
anchor: {
horizontal: FrameAnchorType.PAGE,
vertical: FrameAnchorType.PAGE,
},
wrap: FrameWrap.AROUND,
});
// Frame with alignment positioning and drop cap
createFrameProperties({
type: "alignment",
alignment: {
x: HorizontalPositionAlign.LEFT,
y: VerticalPositionAlign.TOP,
},
width: 1440,
height: 1440,
anchor: {
horizontal: FrameAnchorType.TEXT,
vertical: FrameAnchorType.TEXT,
},
dropCap: DropCapType.DROP,
lines: 3,
});
Creates a frame properties XML component for paragraph text frames.
Frames allow paragraphs to be positioned absolutely on the page with text wrapping. They support both coordinate-based and alignment-based positioning, along with drop cap effects and various text wrapping options.
Reference: http://officeopenxml.com/WPparagraph-textFrames.php
XSD Schema