# RtfShape

Dependency-free representation of an RTF drawing shape, including raw instructions, named properties, and optional text-box content.

Class 

`OfficeIMO.Rtf`

**Namespace**

`OfficeIMO.Rtf`

**Assembly**

`OfficeIMO.Rtf`

**Source revision**

`ba882f6b0d07` with working tree changes

**Source**

[RtfShape.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfShape.cs#L7)

**Implements**

`IRtfCloneable` `IRtfInline` `IRtfBlock`

**Modifiers**

sealed

Dependency-free representation of an RTF drawing shape, including raw instructions, named properties, and optional text-box content.

## Inheritance

- object
- RtfShape

## Usage

Explore 2 API references to this type

This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.

### Returned or exposed by 2

- Method [RtfDocument.AddShape](/api/rtf/officeimo-rtf-rtfdocument/#method-addshape)
- Method [RtfParagraph.AddShape](/api/rtf/officeimo-rtf-rtfparagraph/#method-addshape)

Filter members 

Show inherited

## Constructors

`public RtfShape()` [#](#constructor-ctor)

[RtfShape.cs:7](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfShape.cs#L7)

## Methods

`public RtfShapeInstruction AddInstruction(string name, int? parameter = null, bool hasParameter = true)` [#](#method-addinstruction-string-nullable-system-int32-boolean)

[RtfShape.cs:22](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfShape.cs#L22)

Adds a raw shape instruction control.

Parameters

**name string required**

**parameter int? = null optional**

**hasParameter bool = true optional**

Returns

`RtfShapeInstruction`

`public RtfShapeProperty AddProperty(string name, string? value = null)` [#](#method-addproperty-string-string)

[RtfShape.cs:29](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfShape.cs#L29)

Adds a named shape property.

Parameters

**name string required**

**value string? = null optional**

Returns

`RtfShapeProperty`

`public RtfParagraph AddTextBoxParagraph(string? text = null)` [#](#method-addtextboxparagraph-string)

[RtfShape.cs:36](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfShape.cs#L36)

Adds a paragraph to the shape text box.

Parameters

**text string? = null optional**

Returns

`RtfParagraph`

`public string ToPlainText()` [#](#method-toplaintext)

[RtfShape.cs:47](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfShape.cs#L47)

Returns text-box content with paragraphs separated by new lines.

Returns

`string`

## Inherited Methods

`public virtual bool Equals(object? obj)` [#](#method-equals-object)

Inherited from object

Parameters

**obj object? required**

Returns

`bool`

`public virtual int GetHashCode()` [#](#method-gethashcode)

Inherited from object

Returns

`int`

`public Type GetType()` [#](#method-gettype)

Inherited from object

Returns

`Type`

`public virtual string? ToString()` [#](#method-tostring)

Inherited from object

Returns

`string?`

## Properties

`public IReadOnlyList<RtfShapeInstruction> Instructions { get; }` [#](#property-instructions)

[RtfShape.cs:12](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfShape.cs#L12)

Raw shape instruction controls from \shpinst.

`public IReadOnlyList<RtfShapeProperty> Properties { get; }` [#](#property-properties)

[RtfShape.cs:15](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfShape.cs#L15)

Named shape properties from \sp groups.

`public IReadOnlyList<RtfParagraph> TextBoxParagraphs { get; }` [#](#property-textboxparagraphs)

[RtfShape.cs:18](https://github.com/EvotecIT/OfficeIMO/blob/ba882f6b0d07acddd884b5e7d3086b0cfff0a05a/OfficeIMO.Rtf/Model/RtfShape.cs#L18)

Paragraphs contained by the shape text box destination.

<!-- PowerForge markdown artifact sha256:7E0030E29ABF2FE5E60023E630D9A55BB6BCB12B436070F1DFAD9D869CD5A245 -->
