Represents a rectangle.

For a list of all members of this type, see Rectangle Members


System.Object
   ceTe.DynamicPDF.PageElement
      ceTe.DynamicPDF.PageElements.RotatingPageElement
public class Rectangle : RotatingPageElement, IArea, ICoordinate

Remarks

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

Example

The following example will display a custom rectangle on the page.

[Visual Basic]
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, Color.Black, Color.Gray, Apply.Both, 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
[C#]
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;

class MyClass
{
    static void Main()
    {
        // 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, Color.Black, Color.Gray, Apply.Both, 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( @"C:\MyDocument.pdf" );
    }
} 

Requirements

Namespace: ceTe.DynamicPDF.PageElements Namespace

Assembly: DynamicPDF.Generator.[Edition].dll

See Also

Rectangle members | ceTe.DynamicPDF.PageElements Namespace