Postingan lainnya
Eror ketika web di hosting, dompdf gagal dimuat
hai para suhu ijin bertanya , saya mendapatkan masalah ketika web saya di hosting dompdf gagal dimuat, tetapi ketika menggunakan local server web berfungsi dengan baik .. Minta tolong Pencerahannya Para Suhu..
//controllers
$this->load->library('dompdf_gen');
$this->load->view('pasien/cetakbuktipendaftaran', $data);
$paper_size = 'A4';
$orientation = 'landscape';
$html = $this->output->get_output();
$this->dompdf->set_paper($paper_size, $orientation);
$this->dompdf->load_html($html);
$this->dompdf->render();
$this->dompdf->stream("Bukti Pendaftaran pasien.pdf", array('Attachment' => 1));
//libraries
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* Name: DOMPDF
*
* Author: Jd Fiscus
* jdfiscus@gmail.com
* @iamfiscus
*
*
* Origin API Class: http://code.google.com/p/dompdf/
*
* Location: http://github.com/iamfiscus/Codeigniter-DOMPDF/
*
* Created: 06.22.2010
*
* Description: This is a Codeigniter library which allows you to convert HTML to PDF with the DOMPDF library
*
*/
class Dompdf_gen
{
public function __construct()
{
require_once APPPATH . 'third_party/dompdf/dompdf_config.inc.php';
$pdf = new DOMPDF();
$CI = &get_instance();
$CI->dompdf = $pdf;
}
}
4 Jawaban:
Struktur folder projects nya kaya gimana gan?
seperti ini bro..
<img src='https://i.ibb.co/8zyk6qK/bandicam-2020-06-18-13-16-01-113.jpg'>
<pre>require_once APPPATH . 'third_party/dompdf/dompdf_config.inc.php';</pre><div><br> Pastikan file yang dimaksud berada di "/application/third_party/dompdf"<br><br>APPPATH adalah konstan CI untuk mengakses lokasi /application/</div>
<div>file dompdf_gen.php yang ada di folder library diganti menjadi Dompdf_gen.php</div>
Tanggapan
solved bang, tengkyu