Table of Contents

Class PositionedTextBox

Namespace
DocWright.Dom
Assembly
DocWright.Dom.dll

A text box positioned on the page — a floating DrawingML wps:txbx or VML v:textbox that DocWright draws as its text, clipped to the box — anchored in the paragraph that holds it.

public sealed class PositionedTextBox : RunContentInline
Inheritance
PositionedTextBox
Inherited Members
Extension Methods

Remarks

Added in Phase 72. Before it, the DOCX reader built such a box as an ImageRef whose ContentType was application/vnd.docwright.textbox and whose Description held the text, so everything that walked images had to know to skip it and everything that wanted the text had to know to look inside an image. A model built that way by older code is still drawn exactly as before; the reader no longer builds one.

Text boxes the reader models as shapes — DrawingML shapes with a text body, which is most of them — are ShapeRef nodes, and keep their paragraphs. This node is the box the reader could place but not model as a shape: its content is flattened to Segments, and what it held beyond text (a picture, a table, a hyperlink) is reported as unsupported when the document is read. Two shapes reach it that a reader of the markup might not expect: a text box on a drawing canvas (wpc:wpc), and a VML text box inside a v:group that has no box of its own.

The source markup is kept as a preserved island and is what a DOCX save writes; a box built in memory, with no island, cannot be written to DOCX yet and is reported as such.

Constructors

PositionedTextBox()

Initializes an empty text box.

Properties

Anchor

Gets or sets where the box sits and how text wraps around it, or null for the page origin with no wrap data.

DrawingId

Gets or sets the drawing object id (wp:docPr id), or null.

Height

Gets or sets the box's height (wp:extent cy, or the VML style's height).

InsetBottom

Gets or sets the distance from the box's bottom edge to its text (wps:bodyPr bIns), or null.

InsetLeft

Gets or sets the distance from the box's left edge to its text (wps:bodyPr lIns), or null when the markup states no body properties.

InsetRight

Gets or sets the distance from the box's right edge to its text (wps:bodyPr rIns), or null.

InsetTop

Gets or sets the distance from the box's top edge to its text (wps:bodyPr tIns), or null.

Name

Gets or sets the drawing object name (wp:docPr name), or null.

Segments

Gets the box's content, in order: text, with '\n' between paragraphs, and page numbers.

Text

Gets the box's text, with each page number as the result the document last stored for it: what a consumer with no pages to number shows.

Width

Gets or sets the box's width (wp:extent cx, or the VML style's width).

Methods

Accept(DomVisitor)

Dispatches to the visitor method for this node's concrete type.

CloneCore()

Creates the deep copy for Clone(). Implementations copy all owned state, deep-clone children and copy unknown-XML islands.