1
I have the following problem, I have these value in html with php (fetch the values from mysql):
And my goal would be through the use of materialize buttons gave the possibility to the user to make screenshot or turn these values into pdf so later they can print.
I’ve been searching and I thought the best would be to use to convert dompdf into pdf. Here’s the code I got:
<?php
use Dompdf\Dompdf;
// include autoloader
require_once 'dompdf/autoload.inc.php';
//criar a intancia
$dompdf = new DOMPDF();
$dompdf->load_html('
<h1>Não sei como meter aqui os valores</h1>
');
//renderizar
$dompdf->render();
//exibir pagina
$dompdf->stream(
"relatorio_pii.pdf",
array(
"Attachment"=> false
)
)
?>
And now the code of my buttons:
<div class="fixed-action-btn click-to-toggle">
<a class="btn-floating btn-large red">
<i class="material-icons">menu</i>
</a>
<ul>
<li><a class="btn-floating red"><i class="material-icons">save</i><input type="submit" name="submitpdf" value="Download pdf file" class="input-button"/></a></li>
<li><a class="btn-floating yellow darken-1"><i class="material-icons">camera_alt</i></a></li>
<li><a class="btn-floating blue"><i class="material-icons">show_chart</i></a></li>
</ul>
</div>
The problem is that I don’t know where to put the php formula to print and call on the print button. Please really appreciate your help.