The PHP PDF Multicell is a package library that allows developers to create PDFs with pre-defined set page settings and layouts that can be easily used to create a professional-looking document. The package library is mostly used for creation of invoices, reports, and other printable materials.
Example 1: Creating a multicell table
require('fpdf.php');
$pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','',14);
$pdf->Cell(60,10,'John Smith',1); $pdf->Cell(70,10,'123 Main St',1); $pdf->Cell(50,10,'123-456-7890',1); $pdf->Ln();
$pdf->Cell(60,10,'Jane Doe',1); $pdf->Cell(70,10,'456 Oak Ave',1); $pdf->Cell(50,10,'555-555-5555',1); $pdf->Ln();
$pdf->Output();
This code creates a simple table with three columns - Name, Address, and Phone - and two rows of data. Each column is a multicell object, with the width and height specified in pixels.
Example 2: Creating a multicell paragraph
require('fpdf.php');
$pdf = new FPDF(); $pdf->AddPage(); $pdf->SetFont('Arial','',14);
$pdf->MultiCell(0,10,"This is a paragraph of text that will span multiple cells. It can be used to create long blocks of text that are easier to read in a PDF document.",0); $pdf->Ln();
$pdf->Output();
This code creates a single multicell object that spans the width of the page, and contains a paragraph of text that will automatically wrap around to the next line as needed.
In conclusion, PHP PDF Multicell is a package library that is used to create professional PDF files with pre-defined layouts, it is mostly used for invoices, reports, and other printable materials. The two examples give an insight into its usage.
PHP pdf::MultiCell - 5 examples found. These are the top rated real world PHP examples of pdf::MultiCell extracted from open source projects. You can rate examples to help us improve the quality of examples.