Class

# PDFShape

<div class="rst-class">

forsearch

</div>

PDF

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

## Description

A rectangle or oval shape that can be placed anywhere on the page.

## Properties

<div class="rst-class">

table-centered_columns_3_and_4

</div>

| Name                                  | Type                                                               | Read-Only | Shared |
|---------------------------------------|--------------------------------------------------------------------|-----------|--------|
| `BorderEffect<pdfshape.bordereffect>` | `PDFAnnotation.BorderEffectTypes<pdfannotation.bordereffecttypes>` |           |        |
| `BorderStyle<pdfshape.borderstyle>`   | `PDFAnnotation.BorderStyles<pdfannotation.borderstyles>`           |           |        |
| `BorderWidth<pdfshape.borderwidth>`   | `Double</api/data_types/double>`                                   |           |        |
| `DashPattern()<pdfshape.dashpattern>` | `Double</api/data_types/double>`                                   |           |        |
| `DrawingColor<pdfshape.drawingcolor>` | `Color</api/data_types/color>`                                     |           |        |
| `FillColor<pdfshape.fillcolor>`       | `Color</api/data_types/color>`                                     |           |        |
| `Height<pdfshape.height>`             | `Double</api/data_types/double>`                                   |           |        |
| `ShapeType<pdfshape.shapetype>`       | `ShapeTypes<pdfshape.shapetypes>`                                  |           |        |
| `Text<pdfshape.text>`                 | `String</api/data_types/string>`                                   |           |        |
| `Title<pdfshape.title>`               | `String</api/data_types/string>`                                   |           |        |
| `Width<pdfshape.width>`               | `Double</api/data_types/double>`                                   |           |        |

## Methods

<div class="rst-class">

table-centered_column_4

</div>

| Name                                | Parameters                                                                                                                                                                                                                                                                                                     | Returns | Shared |
|-------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|--------|
| `Constructor<pdfshape.constructor>` | text As `String</api/data_types/string>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`, width As `Integer</api/data_types/integer>`, height As `Integer</api/data_types/integer>`, type As `ShapeTypes<pdfshape.shapetypes>` = `ShapeTypes.Rectangle<pdfshape.shapetypes>` |         |        |

## Enumerations

<div id="pdfshape.shapetypes">

<div class="rst-class">

forsearch

</div>

</div>

PDFShape.ShapeTypes

### ShapeTypes

> The shapes that can be designated when creating a <span class="title-ref">PDFShape</span>.
>
> | Name      |
> |-----------|
> | Rectangle |
> | Oval      |

## Property descriptions

<div id="pdfshape.bordereffect">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.BorderEffect

**BorderEffect** As `PDFAnnotation.BorderEffectTypes<pdfannotation.bordereffecttypes>`

> Determines how the border of the shape will be drawn.

<div id="pdfshape.borderstyle">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.BorderStyle

**BorderStyle** As `PDFAnnotation.BorderStyles<pdfannotation.borderstyles>`

> Determines the line style of the border.

<div id="pdfshape.borderwidth">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.BorderWidth

**BorderWidth** As `Double</api/data_types/double>`

> The width of the shape's border.

<div id="pdfshape.dashpattern">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.DashPattern

**DashPattern()** As `Double</api/data_types/double>`

> Determines the spacing between lines used when drawing the border.

<div id="pdfshape.drawingcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.DrawingColor

**DrawingColor** As `Color</api/data_types/color>`

> The color that will be used to draw the background of the shape.

<div id="pdfshape.fillcolor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.FillColor

**FillColor** As `Color</api/data_types/color>`

> The color used to fill the background of the shape.

<div id="pdfshape.height">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.Height

**Height** As `Double</api/data_types/double>`

> The height of the shape.

<div id="pdfshape.shapetype">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.ShapeType

**ShapeType** As `ShapeTypes<pdfshape.shapetypes>`

> The type of shape (rectangle or oval).

<div id="pdfshape.text">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.Text

**Text** As `String</api/data_types/string>`

> The text that appears in a popover area when the cursor is within the shape.

<div id="pdfshape.title">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.Title

**Title** As `String</api/data_types/string>`

> The title of the shape.
>
> The Title is not rendered. PDF reader applications that have the ability to show the properties of an element in a PDF document will show the value of the Title property.

<div id="pdfshape.width">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.Width

**Width** As `Double</api/data_types/double>`

> The width of the shape.

## Method descriptions

<div id="pdfshape.constructor">

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

</div>

<div class="rst-class">

forsearch

</div>

PDFShape.Constructor

**Constructor**(text As `String</api/data_types/string>`, x As `Integer</api/data_types/integer>`, y As `Integer</api/data_types/integer>`, width As `Integer</api/data_types/integer>` = , height As `Integer</api/data_types/integer>` = , type As `PDFShape.ShapeTypes<pdfshape.shapetypes>` = `PDFShape.ShapeTypes.Rectangle<pdfshape.shapetypes>`)

> Creates the shape from the parameters passed.

## Sample code

This example creates a PDF document with a shape that looks like cloud with some text:

``` xojo
Var d As New PDFDocument

Var shape As New PDFShape("Shape", 200, 20, 150, 100)
shape.BorderWidth = 5
shape.DrawingColor = &cBBFFFF00
shape.ShapeType = PDFShape.ShapeTypes.Oval
shape.BorderEffect = PDFAnnotation.BorderEffectTypes.Cloudy
shape.Text = "I'm in a Cloud!"
shape.BorderStyle = PDFAnnotation.BorderStyles.Solid
shape.DashPattern = Array(1.0, 2.0)

d.AddShape(shape)
```

## Compatibility

|                       |                               |
|-----------------------|-------------------------------|
| **Project Types**     | Console, Desktop, Mobile, Web |
| **Operating Systems** | iOS, Linux, macOS, Windows    |

<div class="seealso">

`PDFAnnotation</api/pdf/pdfannotation>` parent class; `PDFLine</api/pdf/pdfline>` and `PDFCallout</api/pdf/pdfcallout>` classes

</div>
