Estoy probando usar htm2pdf la libreria para pasar codigo html a PDF, tengo el siguiente codigo que genera el PDF
<?$dni=$_GET["dni"];$url='verficha.php?dni=12345678aa';require __DIR__.'/pdf/vendor/autoload.php';use Spipu\Html2Pdf\Html2Pdf;try{$html2pdf = new HTML2PDF('P', 'A4', 'en');$html = file_get_contents($url);$html2pdf->writeHTML($html);$html2pdf->output();}catch(HTML2PDF_exception $e) { echo $e; exit;}?>
<?
$dni=$_GET["dni"];
$url='verficha.php?dni=12345678aa';
require __DIR__.'/pdf/vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
try
{
$html2pdf = new HTML2PDF('P', 'A4', 'en');
$html = file_get_contents($url);
$html2pdf->writeHTML($html);
$html2pdf->output();
}
catch(HTML2PDF_exception $e) {
echo $e;
exit;
}?>
El problema que al ejecutarlo me genera este error:
[25-Nov-2020 19:20:45 Europe/Madrid] PHP Fatal error: Uncaught Spipu\Html2Pdf\Exception\HtmlParsingException: Tags are closed in a wrong order for [center] in /public_html/pdf/vendor/spipu/html2pdf/src/Parsing/Html.php:262Stack trace:#0 /home/apptptrainercdwh/public_html/pdf/vendor/spipu/html2pdf/src/Parsing/Html.php(94): Spipu\Html2Pdf\Parsing\Html->getTagAction(Object(Spipu\Html2Pdf\Parsing\Token), Array)#1 /home/apptptrainercdwh/public_html/pdf/vendor/spipu/html2pdf/src/Html2Pdf.php(594): Spipu\Html2Pdf\Parsing\Html->parse(Array)#2 /home/apptptrainercdwh/public_html/exportar_ficha.php(19): Spipu\Html2Pdf\Html2Pdf->writeHTML('<page></br></br...')#3 {main} thrown in /home/apptptrainercdwh/public_html/pdf/vendor/spipu/html2pdf/src/Parsing/Html.php on line 262
[25-Nov-2020 19:20:45 Europe/Madrid] PHP Fatal error: Uncaught Spipu\Html2Pdf\Exception\HtmlParsingException: Tags are closed in a wrong order for [center] in /public_html/pdf/vendor/spipu/html2pdf/src/Parsing/Html.php:262
Stack trace:
#0 /home/apptptrainercdwh/public_html/pdf/vendor/spipu/html2pdf/src/Parsing/Html.php(94): Spipu\Html2Pdf\Parsing\Html->getTagAction(Object(Spipu\Html2Pdf\Parsing\Token), Array)
#1 /home/apptptrainercdwh/public_html/pdf/vendor/spipu/html2pdf/src/Html2Pdf.php(594): Spipu\Html2Pdf\Parsing\Html->parse(Array)
#2 /home/apptptrainercdwh/public_html/exportar_ficha.php(19): Spipu\Html2Pdf\Html2Pdf->writeHTML('<page></br></br...')
#3 {main}
thrown in /home/apptptrainercdwh/public_html/pdf/vendor/spipu/html2pdf/src/Parsing/Html.php on line 262
Nose porque me genera este error ya que es la primera vez que utilizo esta libreria y nose que esta ejecutandose mal