docx
    Preparing search index...

    Module shapes

    Shapes for docx documents: the preset shapes, such as rectangles, arrows and flowchart symbols, groups of shapes, and drawing canvases whose connectors stay attached to the shapes they join.

    Shapes come with the docx package, from docx/shapes. Everything else, such as the document and its paragraphs, comes from docx.

    import { Document, Packer, Paragraph } from "docx";
    import { ShapeRun } from "docx/shapes";

    const doc = new Document({
    sections: [
    {
    children: [
    new Paragraph({
    children: [new ShapeRun({ type: "ellipse", transformation: { width: 120, height: 60 }, fill: "4472C4" })],
    }),
    ],
    },
    ],
    });

    const buffer = await Packer.toBuffer(doc);
    ShapeCanvasRun
    ShapeGroupRun
    ShapeRun
    Arrowhead
    ArrowheadSize
    ArrowheadType
    ConnectorEnd
    ConnectorLabel
    ConnectorLabelPosition
    ConnectorPoint
    ConnectorRoute
    ConnectorSide
    CustomLineDash
    CustomShapeConnectionPoint
    CustomShapeGeometry
    CustomShapePath
    CustomShapePathFill
    CustomShapeTextArea
    GradientPath
    GradientShapeFill
    GradientStop
    ImageSource
    IShapeCanvasChildOptions
    IShapeCanvasOptions
    IShapeConnectorOptions
    IShapeGroupChildOptions
    IShapeGroupOptions
    IShapeNestedGroupOptions
    IShapeOptions
    IShapePictureOptions
    LineDash
    PatternShapeFill
    PictureShapeFill
    PictureTile
    PictureTileAlignment
    PictureTileMirror
    PresetShapeAdjustments
    PresetShapeType
    ShapeAdjustments
    ShapeColor
    ShapeCompoundLine
    ShapeEffects
    ShapeFill
    ShapeFloating
    ShapeFlowLayout
    ShapeGlow
    ShapeGridLayout
    ShapeHeightRelativeTo
    ShapeHorizontalPosition
    ShapeLane
    ShapeLayout
    ShapeLayoutDirection
    ShapeLine
    ShapeLineCap
    ShapeLineJoin
    ShapeLineOptions
    ShapePattern
    ShapePercentage
    ShapeReflection
    ShapeShadow
    ShapeSize
    ShapeTextDirection
    ShapeTextOptions
    ShapeTextVerticalAlignment
    ShapeTextWarp
    ShapeThemeColor
    ShapeThemeColorName
    ShapeTransformation
    ShapeTreeLayout
    ShapeVerticalPosition
    ShapeWidthRelativeTo
    SolidShapeFill