This commit is contained in:
wangjinlei
2024-07-17 09:23:45 +08:00
parent edf9deeb1a
commit 881ac3e056
1001 changed files with 41032 additions and 5452 deletions

View File

@@ -22,6 +22,9 @@
* @abstract TCPDF - Example: WriteHTML and RTL support
* @author Nicola Asuni
* @since 2008-03-04
* @group html
* @group rtl
* @group pdf
*/
// Include the main TCPDF library (search for installation path).
@@ -224,6 +227,20 @@ $html = '<h1>Image alignments on HTML table</h1>
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
// create some HTML content
$html = '<h1>Embedded Images</h1>
<table cellpadding="1" cellspacing="1" border="1" style="text-align:center;">
<tr><td>src="@..." </td><td><img src="@DATA1@" border="0" height="41" width="41" /></td></tr>
<tr><td>src="data..."</td><td><img src="@DATA2@" border="0" height="41" width="41" /></td></tr>
</table>';
$data = base64_encode(file_get_contents("images/logo_example.png"));
$html = str_replace("@DATA1@", "@" . $data, $html);
$html = str_replace("@DATA2@", "data:image/png;base64," . $data, $html);
// output the HTML content
$pdf->writeHTML($html, true, false, true, false, '');
// reset pointer to the last page
$pdf->lastPage();