<?Php
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$width=$pdf->GetPageWidth(); // Width of Current Page
$height=$pdf->GetPageHeight(); // Height of Current Page
$pdf->Line(0, 0,$width,$height); // Line one Cross
$pdf->Line($width, 0,0,$height); // Line two Cross
$pdf->Output();
?>
<?Php
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$width=$pdf->GetPageWidth(); // Width of Current Page
$height=$pdf->GetPageHeight(); // Height of Current Page
$gap=2; // Gap between line and border , change this value
$pdf->Line($gap, $gap,$width-$gap,$gap); // Horizontal line at top
$pdf->Line($gap, $height-$gap,$width-$gap,$height-$gap); // Horizontal line at bottom
$pdf->Line($gap, $gap,$gap,$height-$gap); // Vetical line at left
$pdf->Line($width-$gap, $gap,$width-$gap,$height-$gap); // Vetical line at Right
$pdf->Output();
?>
Drawing patterns of lines on PDF document by FPDF class in PHP using color and width of the line
Draw patterns of square boxes with reducing dimension across the page
<?Php
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$width=$pdf->GetPageWidth(); // Width of Current Page
$height=$pdf->GetPageHeight(); // Height of Current Page
$gap=2; // Gap between line and border
for($gap=2;$gap<=$width/2; $gap+=2){
$pdf->Line($gap, $gap,$width-$gap,$gap); // Horizontal line at top
$pdf->Line($gap, $height-$gap,$width-$gap,$height-$gap); // Horizontal line at bottom
$pdf->Line($gap, $gap,$gap,$height-$gap); // Vetical line at left
$pdf->Line($width-$gap, $gap,$width-$gap,$height-$gap); // Vetical line at Right
}
$pdf->Output();
?>
<?Php
require('fpdf.php');
$pdf = new FPDF();
$pdf->AddPage();
$width=$pdf->GetPageWidth(); // Width of Current Page
$height=$pdf->GetPageHeight(); // Height of Current Page
$gap=2; // Gap between line and border
$pdf->SetLineWidth(0.8);
$pdf->SetDrawColor(10,10,10);
for($gap=2;$gap<=$width/2; $gap+=5){
$pdf->SetDrawColor(10+(3*$gap),10+$gap,10+$gap);
$pdf->Line($gap, $gap,$width-$gap,$gap); // Horizontal line at top
$pdf->Line($gap, $height-$gap,$width-$gap,$height-$gap); // Horizontal line at bottom
$pdf->Line($gap, $gap,$gap,$height-$gap); // Vetical line at left
$pdf->Line($width-$gap, $gap,$width-$gap,$height-$gap); // Vetical line at Right
}
$pdf->Output();
?>