Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created December 26, 2019 02:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/5ad8ed79fe9bf02902faac73f8b888d3 to your computer and use it in GitHub Desktop.
Save parzibyte/5ad8ed79fe9bf02902faac73f8b888d3 to your computer and use it in GitHub Desktop.
<?php
include_once "./vendor/autoload.php";
use Dompdf\Dompdf;
$dompdf = new Dompdf();
ob_start();
include "./tabla_estilos.php";
$html = ob_get_clean();
$dompdf->loadHtml($html);
$dompdf->render();
header("Content-type: application/pdf");
header("Content-Disposition: inline; filename=documento.pdf");
echo $dompdf->output();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment