private void printDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { // Set the color of the pen Pen pen = new Pen(Color.Black, 3); // Draw a rectangle on the page e.Graphics.DrawRectangle(pen, 50, 50, 200, 100); }In this example, we use the Graphics object to draw a rectangle on the page with a black pen of width 3. The rectangle is positioned at (50, 50), with a width of 200 and a height of 100. The PrintPageEventArgs class is part of the System.Drawing.Printing namespace, which contains classes and interfaces related to printing in the .NET Framework.