Hello..,
versuche seit drei Tagen eine PDF zu erstellen und bin kläglich gescheitert.
Habe TCPDF mit dem Composer installiert. Funktioniert alles super.
Jedoch wird nach der Erstellung keine Schrift angezeigt. Dachte es liegt evtl an der Font jedoch werden diese von Hause aus mitgeliefert.
In den Mitgelieferten examples funktioniert alles Top.
Ick wess einfach nicht mehr weiter!
Bitte helft mir..
Warum der Code so besch.. dagestellt wird ist unklar!
versuche seit drei Tagen eine PDF zu erstellen und bin kläglich gescheitert.
Habe TCPDF mit dem Composer installiert. Funktioniert alles super.
Jedoch wird nach der Erstellung keine Schrift angezeigt. Dachte es liegt evtl an der Font jedoch werden diese von Hause aus mitgeliefert.
In den Mitgelieferten examples funktioniert alles Top.
Ick wess einfach nicht mehr weiter!
Bitte helft mir..
PHP-Code:
require_once dirname(__FILE__) . '/../../vendor/autoload.php'; /** * Creates an example PDF TEST document using TCPDF * @package com.tecnick.tcpdf * @abstract TCPDF - Example: WriteHTML and RTL support * @author Nicola Asuni * @since 2008-03-04 */ // Include the main TCPDF library (search for installation path). // create new PDF document $pdf = new \TCPDF('P', 'mm', 'A4', true, 'UTF-8', false); $pdf->SetCreator('TOM'); $pdf->SetAuthor('Nicola Asuni'); $pdf->SetTitle('TCPDF Example 001'); $pdf->SetSubject('TCPDF Tutorial'); $pdf->SetKeywords('TCPDF, PDF, example, test, guide'); $pdf->setFontSubsetting(true); $pdf->SetFont('times', '', 14, '', true); // add a page $pdf->AddPage(); // create some HTML content $html = '<h1>Welcome to <a href="http://www.tcpdf.org" style="text-decoration:none;background-color:#CC0000;color:black;"> <span style="color:black;">TC</span><span style="color:white;">PDF</span> </a>!</h1> <i>This is the first example of TCPDF library.</i> <p>This text is printed using the <i>writeHTMLCell()</i> method but you can also use: <i>Multicell(), writeHTML(), Write(), Cell() and Text()</i>.</p> <p>Please check the source code documentation and other examples for further information.</p> <p style="color:#CC0000;">TO IMPROVE AND EXPAND TCPDF I NEED YOUR SUPPORT, PLEASE <a href="http://sourceforge.net/donate/index.php?group_id=128076">MAKE A DONATION!</a></p>'; $pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true); // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // reset pointer to the last page $pdf->lastPage(); // --------------------------------------------------------- //Close and output PDF document $pdf->Output('test.pdf'); //============================================================+ // END OF FILE //============================================================+
Kommentar