Męczę się już od 2 godzin z implementacją kodu w $html
Strona ma się wyświetlić w pdf
Proszę o pomoc.
require_once('tcpdf_include.php'); $pdf = new TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false); $pdf->SetMargins(PDF_MARGIN_LEFT+10, 8, PDF_MARGIN_RIGHT+10); //marginesy. drugi - góra $pdf->setImageScale(PDF_IMAGE_SCALE_RATIO); if (@file_exists(dirname(__FILE__).'/lang/pol.php')) { require_once(dirname(__FILE__).'/lang/pol.php'); $pdf->setLanguageArray($l); } $pdf->setPrintHeader(false); // usunięcie stopki i nagłówka strony header/footer $pdf->setPrintFooter(false); $pdf->SetFont('dejavusans', '', 8); //polskie znaki - dejavusans lub freesans $pdf->AddPage(); $html = ' <?php foreach($reportData as $data) {?> <div class="pageWrapper"> <div class="page" id="page" style="float:left"> <div class="subpage"> <div style="font-size:20px;padding-bottom:50px;" align="center"> <b>Zestawienie przeglądów urządzeń<br> fiskalnych dla Urzędu Skarbowego<br> </b></div> <div style="float:left;text-align:left;"> <b>Wystawca zestawienia:</b><br> </div> <div style="float:right;text-align:right;"> <b>Odbiorca zestawienia:</b><br> Naczelnik urzędu skarbowego<br> </div> <div style="padding-top: 40px;clear: both;"> <table id="report"> <thead> <tr> <th>Lp.</th> <th class="nip">NIP Podatnika</th> <th>Nazwa Podatnika</th> <th class="adres">Adres podatnika</th> <th>Numer seryjny i unikatowy</th> <th>Numer ewidencyjny</th> <th>Data przeglądu</th> </tr> </thead> <tbody> <?php $s = 0; foreach($data['dane'] as $val) { $s++; ?> <tr> </tr> <?php } ?> </tbody> </table> </div> </div> </div> </div> <?php } ?> '; $pdf->writeHTML($html, true, false, true, false, ''); $pdf->Output('przyklad.pdf', 'I');