require_once('tcpdf/tcpdf.php'); $pdf = new TCPDF(); $pdf->SetAuthor('John Smith'); $pdf->AddPage(); $pdf->SetFont('times', '', 12); $pdf->Cell(0, 10, 'Hello World!', 0, 1); $pdf->Output('example.pdf', 'D');
require_once('tcpdf/tcpdf.php'); $pdf = new TCPDF(); $pdf->SetAuthor('Jane Doe'); $html = "In this example, the SetAuthor method is used to set the author of the PDF document to "Jane Doe". The PDF document is then generated with an HTML heading and paragraph, and is downloaded by the user. Package library: TCPDFA Sample Heading
"; $html .= "This is a sample paragraph.
"; $pdf->writeHTML($html, true, false, true, false, ''); $pdf->Output('example.pdf', 'D');