1
This commit is contained in:
17
vendor/tecnickcom/tcpdf/examples/example_006.php
vendored
17
vendor/tecnickcom/tcpdf/examples/example_006.php
vendored
@@ -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();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user