$pdf = new TCPDF(); $pdf->SetSubject('My First PDF Document'); $pdf->Output('my_document.pdf', 'D');
require_once('tcpdf/tcpdf.php'); $pdf = new TCPDF(); $pdf->SetSubject('My Second PDF Document'); $pdf->AddPage(); $pdf->SetFont('helvetica', '', 12); $txt = 'This is my second PDF document.'; $pdf->Write(0, $txt, '', 0, 'C'); $pdf->Output('my_second_document.pdf', 'I');In the above code example, we require the TCPDF library and create a new TCPDF object. We set the subject of the PDF document to "My Second PDF Document" and add a page to the document. We then set the font and write some text to the PDF document. Finally, we output the PDF document inline in the user's browser. Package/Library: TCPDF.