Rectangle

Represents a rectangle page element.

public class Rectangle : RotatingPageElement, IArea, ICoordinate, ISerializable
Public Class Rectangle
    Inherits RotatingPageElement
    Implements IArea, ICoordinate, ISerializable

Inheritance: ObjectPageElementTaggablePageElementRotatingPageElementRectangle

Implements: IArea, ICoordinate, ISerializable

Licensing Info

This class is a DynamicPDF Core Suite Essentials feature. One of the following is required for non-evaluation usage:

Examples

The following example will display a custom rectangle on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
	 
Module MyModule
	 		
	Sub Main()
	 		
	    ' Create a PDF Document
	    Dim MyDocument As Document = New Document 
	 		
	    ' Create a Page and add it to the document
	    Dim MyPage As Page = New Page
	    MyDocument.Pages.Add(MyPage)
	 
	    ' Create a rectangle
	    Dim MyRectangle As Rectangle = New Rectangle(50, 50, 200, _
	 	200, Grayscale.Black, RgbColor.Gray, 4, LineStyle.Solid)
	 
	    ' Change the corner radius property 
	    MyRectangle.CornerRadius = 10
	 
	    ' Add the rectangle to the page
	    MyPage.Elements.Add(MyRectangle)
	 
	    ' Save the PDF
	    MyDocument.Draw("C:\MyDocument.pdf")
	 		
	End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

public class Example
{
    public static void CreatePDF(string outputPath)
    {
        // Create a PDF Document
        Document document = new Document();

        // Create a Page and add it to the document
        Page page = new Page();
        document.Pages.Add(page);

        // Create a rectangle
        Rectangle rectangle = new Rectangle(50, 50, 200, 200,
           Grayscale.Black, RgbColor.Gray, 4, LineStyle.Solid);

        // Change the corner radius property
        rectangle.CornerRadius = 10;

        // Add the rectangle to the page
        page.Elements.Add(rectangle);

        // Save the PDF
        document.Draw(outputPath);
    } 
}

Remarks

This class can be used to place rectangles of any size or color on a page.

Constructors

Rectangle(Single, Single, Single, Single)Initializes a new instance of the Rectangle class.
Rectangle(Single, Single, Single, Single, Color)Initializes a new instance of the Rectangle class.
Rectangle(Single, Single, Single, Single, Color, Color)Initializes a new instance of the Rectangle class.
Rectangle(Single, Single, Single, Single, Color, Color, Single)Initializes a new instance of the Rectangle class.
Rectangle(Single, Single, Single, Single, Color, Color, Single, LineStyle)Initializes a new instance of the Rectangle class.
Rectangle(Single, Single, Single, Single, Color, Single)Initializes a new instance of the Rectangle class.
Rectangle(Single, Single, Single, Single, Color, Single, LineStyle)Initializes a new instance of the Rectangle class.
Rectangle(Single, Single, Single, Single, Single)Initializes a new instance of the Rectangle class.
Rectangle(Single, Single, Single, Single, Single, Color)Initializes a new instance of the Rectangle class.
Rectangle(Single, Single, Single, Single, Single, LineStyle)Initializes a new instance of the Rectangle class.

Properties

AngleGets or sets the heights of the angle element.
(Inherited from RotatingPageElement)
BorderColorGets or sets the Color object to use for the border of the rectangle.
BorderStyleGets or sets the LineStyle object used to specify the border style of the rectangle.
BorderWidthGets or sets the border width of the rectangle.
CornerRadiusGets or sets the corner radius of the rectangle.
FillColorGets or sets the Color object to use for the fill of the rectangle.
HeightGets or sets the heights of the page element.
(Inherited from RotatingPageElement)
IDGets or sets the ID of the page element.
(Inherited from PageElement)
IgnoreMarginsGets or sets ignore margin property. Setting false will consider the margin while placing the page element based on the RelativeTo property.
(Inherited from PageElement)
RelativeToGets and sets placement of the page element on the page.
(Inherited from PageElement)
TagGets or sets the tag of the taggable element.
(Inherited from TaggablePageElement)
TagOrderGets or sets the tag order of the taggable element.
(Inherited from TaggablePageElement)
WidthGets or sets the width of the rectangle.
XGets or sets the X coordinate of the page element.
(Inherited from RotatingPageElement)
YGets or sets the Y coordinate of the page element.
(Inherited from RotatingPageElement)

Methods

Draw(PageWriter)Draws the page element to the given PageWriter object.
(Inherited from RotatingPageElement)
Equals(Object)Determines whether the specified Object is equal to the current Object .
(Inherited from Object)
GetHashCode()Serves as a hash function for a particular type.
(Inherited from Object)
GetType()Gets the Type of the current instance.
(Inherited from Object)
ToString()Returns a String that represents the current Object .
(Inherited from Object)

See Also

ceTe.DynamicPDF.PageElements

In this topic