| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- error_reporting(E_ERROR);
- require_once 'dompdf/autoload.inc.php';
- use Dompdf\Dompdf;
- /*define('DB_ENGINE', 'mysql');
- define('DB_HOST', 'localhost');
- define('DB_PORT', 3306);
- define('DB_USER', 'erp.koos-weber.hu');
- define('DB_PW', 'Riobi4ee');
- define('DB_DBNAME', 'erp_koos_weber_hu');*/
- define('DB_ENGINE','mysql');
- define('DB_HOST','localhost');
- define('DB_PORT',3306);
- define('DB_USER','rockhu');
- define('DB_PW','coo4hu2N');
- define('DB_DBNAME','rockhu');
- $conn = new mysqli(DB_HOST,DB_USER,DB_PW,DB_DBNAME);
- $conn->query("SET NAMES utf8");
- // instantiate and use the dompdf class
- $dompdf = new Dompdf();
- $options = $dompdf->getOptions();
- $dompdf->set_option('defaultFont', 'DejaVu Sans');
- //$options->setChroot('');
- $dompdf->setOptions($options);
- $html = file_get_contents($_REQUEST['fname']);
- //$html = mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8');
- $dompdf->loadHtml($html,'UTF-8');
- // (Optional) Setup the paper size and orientation
- $dompdf->setPaper('A4', 'portrai');
- // Render the HTML as PDF
- $dompdf->render();
- //$filename = time().'.pdf';
- //$full_path = 'export/pdf/'.$filename;
- //$url = 'http://rockhome.hu/'.$full_path;
- //echo $url;
- $dompdf->stream(time());
|