docx
    Preparing search index...

    Function createHorizontalPosition

    • Creates a horizontal position element for floating drawings.

      The positionH element specifies the horizontal positioning of a floating object relative to a base element (page, margin, column, etc.).

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

      <xsd:complexType name="CT_PosH">
      <xsd:choice>
      <xsd:element name="align" type="ST_AlignH"/>
      <xsd:element name="posOffset" type="ST_PositionOffset"/>
      </xsd:choice>
      <xsd:attribute name="relativeFrom" type="ST_RelFromH" use="required"/>
      </xsd:complexType>

      Parameters

      Returns XmlComponent

      The positionH XML element

      // Align to the left of the page
      createHorizontalPosition({
      relative: HorizontalPositionRelativeFrom.PAGE,
      align: HorizontalPositionAlign.LEFT,
      });

      // Offset from the margin
      createHorizontalPosition({
      relative: HorizontalPositionRelativeFrom.MARGIN,
      offset: 914400, // 1 inch in EMUs
      });