Skip to main content
All docs
V25.1
  • PdfGraphics.DrawRectangle(DXPen, RectangleF) Method

    Draws a rectangle in the specified page area.

    Namespace: DevExpress.Pdf

    Assembly: DevExpress.Pdf.v25.1.Drawing.dll

    NuGet Package: DevExpress.Pdf.Drawing

    Declaration

    public void DrawRectangle(
        DXPen pen,
        RectangleF bounds
    )

    Parameters

    Name Type Description
    pen DXPen

    A DXPen object that specifies the color, width, and style of the rectangle.

    bounds RectangleF

    A RectangleF structure that specifies a page area (in world coordinate system) where you can draw a rectangle.

    Remarks

    Use this method to draw a rectangle in the page area specified by the bounds parameter.

    To draw a shape on the PDF page, use one of the following methods:

    PdfGraphics.AddToPageForeground, PdfGraphics.AddToPageBackground
    These methods allow you to draw content on an existing page.
    PdfDocumentProcessor.RenderNewPage
    Draws content on a new page.
    See Also