AddPage(); // set draw color to red $pdf->SetDrawColor(255, 0, 0); // draw a rectangle $pdf->Rect(10, 10, 50, 50); // output the document $pdf->Output(); ?>In this example, we are creating a PDF document using the FPDF library. We then add a page and set the draw color to red using the SetDrawColor function. Finally, we draw a rectangle using the Rect function and output the document. The package library used in this example is FPDF.