Class
PDFShape
Description
A rectangle or oval shape that can be placed anywhere on the page.
Properties
Name |
Type |
Read-Only |
Shared |
---|---|---|---|
Methods
Name |
Parameters |
Returns |
Shared |
---|---|---|---|
text As String, x As Integer, y As Integer, width As Integer, height As Integer, type As ShapeTypes = ShapeTypes.Rectangle |
Enumerations
PDFShape.ShapeTypes
ShapeTypes
The shapes that can be designated when creating a PDFShape.
Name |
---|
Rectangle |
Oval |
Property descriptions
PDFShape.BorderEffect
BorderEffect As PDFAnnotation.BorderEffectTypes
Determines how the border of the shape will be drawn.
PDFShape.BorderStyle
BorderStyle As PDFAnnotation.BorderStyles
Determines the line style of the border.
PDFShape.BorderWidth
BorderWidth As Double
The width of the shape's border.
PDFShape.DashPattern
DashPattern() As Double
Determines the spacing between lines used when drawing the border.
PDFShape.DrawingColor
DrawingColor As Color
The color that will be used to draw the background of the shape.
PDFShape.FillColor
FillColor As Color
The color used to fill the background of the shape.
PDFShape.Height
Height As Double
The height of the shape.
PDFShape.ShapeType
ShapeType As ShapeTypes
The type of shape (rectangle or oval).
PDFShape.Text
Text As String
The text that appears in a popover area when the cursor is within the shape.
PDFShape.Title
Title As 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.
PDFShape.Width
Width As Double
The width of the shape.
Method descriptions
PDFShape.Constructor
Constructor(text As String, x As Integer, y As Integer, width As Integer = , height As Integer = , type As PDFShape.ShapeTypes = PDFShape.ShapeTypes.Rectangle)
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:
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
Desktop, console, web and iOS project types on all supported operating systems.
See also
PDFAnnotation parent class; PDFLine and PDFCallout classes