Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

PdfGraphics.DrawRectangle(DXPen, RectangleF) Method

Draws a rectangle in the specified page area.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v24.2.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