Postingan lainnya
Buku Ini Koding!
Baru!
Buku ini akan jadi teman perjalanan kamu belajar sampai dapat kerjaan di dunia programming!
tidak muncul tampilan cetak dan tabel
Fatal error: Uncaught Error: Call to undefined function printer_open() in C:\xampp\htdocs\phpbayar\cetak.php:35 Stack trace:
//print: $nis, $nama, $kls, $bln, $tgl_bayar, $jml $sql = mysqli_query($con, "SELECT s.nama,p.tgl_bayar,p.jumlah FROM siswa s INNER JOIN pembayaran p ON s.nis = p.nis AND p.nis='$nis'"); list($nama,$tgl_bayar,$jml) = mysqli_fetch_array($sql);
$printTestText = "NIS : ".$nis."\n"; $printTestText .= "NAMA : ".$nama."\n"; $printTestText .= "KELAS : ".$kls."\n\n"; $printTestText .= "========================================\n"; $printTestText .= str_pad($tgl_bayar,20); $printTestText .= str_pad($bln,3); $printTestText .= str_pad($jml,10," ",STR_PAD_LEFT)."\n"; $printTestText .= "========================================\n"; $printTestText .= "\n"; $printTestText .= "\n"; $printTestText .= str_pad("--= TERIMA KASIH =--",40," ",STR_PAD_BOTH)."\n"; $printTestText .= "\n";
echo'
';
echo $printTestText;
$handle = printer_open('PDFcreator'); //nama printer
printer_set_option($handle, PRINTER_MODE, "TEXT"); //mode printer: RAW, TEXT
printer_write($handle, $printTestText);
printer_close($handle);
echo '
';
//tutup jendela setelah cetak echo '';
1 Jawaban:
coba cek konfigurasi php.ini pada xampp
referensi: https://stackoverflow.com/questions/15338132/call-to-undefined-function-printer-open