docx
    Preparing search index...

    Function createVerticalPosition

    • Creates a vertical position element for floating drawings.

      The positionV element specifies the vertical positioning of a floating object relative to a base element (page, margin, paragraph, line, etc.).

      Reference: https://www.datypic.com/sc/ooxml/e-wp_positionV-1.html

      <xsd:complexType name="CT_PosV">
      <xsd:choice>
      <xsd:element name="align" type="ST_AlignV"/>
      <xsd:element name="posOffset" type="ST_PositionOffset"/>
      </xsd:choice>
      <xsd:attribute name="relativeFrom" type="ST_RelFromV" use="required"/>
      </xsd:complexType>

      Parameters

      Returns XmlComponent

      The positionV XML element

      // Align to the top of the page
      createVerticalPosition({
      relative: VerticalPositionRelativeFrom.PAGE,
      align: VerticalPositionAlign.TOP,
      });

      // Offset from the paragraph
      createVerticalPosition({
      relative: VerticalPositionRelativeFrom.PARAGRAPH,
      offset: 457200, // 0.5 inch in EMUs
      });