<?php require_once("dompdf_config.inc.php"); $html = '<html><body>'. '<p>Put your html here, or generate it with your favourite '. 'templating system.</p>'. '</body></html>'; $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("sample.pdf"); ?>
oczywiscie w tym samym katalogu co rozpakowana paczka, uruchomilem na localu i otrzymałem takie krzaczki:
Kod
[b]Warning[/b]: domdocument::domdocument() expects at least 1 parameter, 0 given in [b]C:\xampp\htdocs\dompdf-0.5.1\include\dompdf.cls.php[/b] on line [b]165[/b]
[b]Fatal error[/b]: Call to undefined method domdocument::loadHTML() in [b]C:\xampp\htdocs\dompdf-0.5.1\include\dompdf.cls.php[/b] on line [b]284
[b]Fatal error[/b]: Call to undefined method domdocument::loadHTML() in [b]C:\xampp\htdocs\dompdf-0.5.1\include\dompdf.cls.php[/b] on line [b]284
linijka 165 to 3 linijka w tym konstruktorze:
<?php * Class constructor */ function __construct() { $this->_xml = new DomDocument(); $this->_xml->preserveWhiteSpace = true; $this->_tree = new Frame_Tree($this->_xml); $this->_css = new Stylesheet(); $this->_pdf = null; $this->_paper_size = "letter"; $this->_paper_orientation = "portrait"; $this->_base_host = ""; $this->_base_path = ""; $this->_cache_id = null; } ?>
a 284 to przedostatnia tutaj:
<?php // Store parsing warnings as messages $this->_xml->loadHTML($str);
Ktoś wie w czym tkwi problem? w ogóle zzieleniałem
