docx
    Preparing search index...

    Function createFrameProperties

    • 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:complexType name="CT_FramePr">
      <xsd:attribute name="dropCap" type="ST_DropCap" use="optional"/>
      <xsd:attribute name="lines" type="ST_DecimalNumber" use="optional"/>
      <xsd:attribute name="w" type="s:ST_TwipsMeasure" use="optional"/>
      <xsd:attribute name="h" type="s:ST_TwipsMeasure" use="optional"/>
      <xsd:attribute name="vSpace" type="s:ST_TwipsMeasure" use="optional"/>
      <xsd:attribute name="hSpace" type="s:ST_TwipsMeasure" use="optional"/>
      <xsd:attribute name="wrap" type="ST_Wrap" use="optional"/>
      <xsd:attribute name="hAnchor" type="ST_HAnchor" use="optional"/>
      <xsd:attribute name="vAnchor" type="ST_VAnchor" use="optional"/>
      <xsd:attribute name="x" type="ST_SignedTwipsMeasure" use="optional"/>
      <xsd:attribute name="xAlign" type="s:ST_XAlign" use="optional"/>
      <xsd:attribute name="y" type="ST_SignedTwipsMeasure" use="optional"/>
      <xsd:attribute name="yAlign" type="s:ST_YAlign" use="optional"/>
      <xsd:attribute name="hRule" type="ST_HeightRule" use="optional"/>
      <xsd:attribute name="anchorLock" type="s:ST_OnOff" use="optional"/>
      </xsd:complexType>

      Parameters

      Returns XmlComponent

      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,
      });