DOM ERROR
This commit is contained in:
parent
e9c0282111
commit
37e0d6d70d
@ -3183,7 +3183,7 @@ class PD_Controller extends REST_Controller {
|
|||||||
public function codeigniterViewTest_post()
|
public function codeigniterViewTest_post()
|
||||||
{
|
{
|
||||||
|
|
||||||
$data['pdid'] = '500';
|
$data['pdid'] = '1256';
|
||||||
$data['main_applicant_name'] = 'Mr.Ram Kumar';
|
$data['main_applicant_name'] = 'Mr.Ram Kumar';
|
||||||
$data['cus_seg'] = 'SENP-AI';
|
$data['cus_seg'] = 'SENP-AI';
|
||||||
$data['lender_name'] = 'HDFC';
|
$data['lender_name'] = 'HDFC';
|
||||||
@ -3200,84 +3200,13 @@ class PD_Controller extends REST_Controller {
|
|||||||
//print_r($t);
|
//print_r($t);
|
||||||
|
|
||||||
//PDF Gen using DOM PDF
|
//PDF Gen using DOM PDF
|
||||||
//$pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
|
$pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait");
|
||||||
//End of PDF Gen using DOM PDF
|
//End of PDF Gen using DOM PDF
|
||||||
|
|
||||||
//PDF GEN BY TCPDF
|
|
||||||
|
|
||||||
// create new PDF document
|
|
||||||
$pdf = new TCPDF();
|
|
||||||
|
|
||||||
// set document information
|
|
||||||
// $pdf->SetCreator(PDF_CREATOR);
|
|
||||||
// $pdf->SetAuthor('SineEdge');
|
|
||||||
// $pdf->SetTitle($data['main_applicant_name']);
|
|
||||||
// $pdf->SetSubject('PD Report of '.$data['main_applicant_name']);
|
|
||||||
// $pdf->SetKeywords('SineEdge, PD Report');
|
|
||||||
|
|
||||||
// set default header data
|
|
||||||
// $pdf->SetHeaderData("C:\Users\VELZ\Desktop\sineedge_red.png", PDF_HEADER_LOGO_WIDTH, $data['main_applicant_name'], "Custom Header", array(0,64,255), array(0,64,128));
|
|
||||||
// $pdf->setFooterData(array(0,64,0), array(0,64,128));
|
|
||||||
|
|
||||||
// set header and footer fonts
|
|
||||||
// $pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
|
|
||||||
// $pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));
|
|
||||||
|
|
||||||
// set default monospaced font
|
|
||||||
//$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);
|
|
||||||
|
|
||||||
// set margins
|
|
||||||
// $pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
|
|
||||||
// $pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
|
|
||||||
// $pdf->SetFooterMargin(PDF_MARGIN_FOOTER);
|
|
||||||
|
|
||||||
// set auto page breaks
|
|
||||||
//$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);
|
|
||||||
|
|
||||||
// set image scale factor
|
|
||||||
//$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
|
||||||
|
|
||||||
// set some language-dependent strings (optional)
|
|
||||||
if (@file_exists(dirname(__FILE__).'/lang/eng.php')) {
|
|
||||||
require_once(dirname(__FILE__).'/lang/eng.php');
|
|
||||||
$pdf->setLanguageArray($l);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
|
||||||
|
|
||||||
// set default font subsetting mode
|
|
||||||
//$pdf->setFontSubsetting(true);
|
|
||||||
|
|
||||||
// Set font
|
|
||||||
// dejavusans is a UTF-8 Unicode font, if you only need to
|
|
||||||
// print standard ASCII chars, you can use core fonts like
|
|
||||||
// helvetica or times to reduce file size.
|
|
||||||
//$pdf->SetFont('dejavusans', '', 10, '', true);
|
|
||||||
|
|
||||||
// Add a page
|
|
||||||
// This method has several options, check the source code documentation for more information.
|
|
||||||
$pdf->AddPage();
|
|
||||||
|
|
||||||
// set text shadow effect
|
|
||||||
//$pdf->setTextShadow(array('enabled'=>true, 'depth_w'=>0.2, 'depth_h'=>0.2, 'color'=>array(196,196,196), 'opacity'=>1, 'blend_mode'=>'Normal'));
|
|
||||||
|
|
||||||
// Set some content to print
|
|
||||||
$html = $t;
|
|
||||||
|
|
||||||
//Print text using writeHTMLCell()
|
|
||||||
$pdf->writeHTMLCell(0, 0, '', '', $html, 0, 1, 0, true, '', true);
|
|
||||||
|
|
||||||
// ---------------------------------------------------------
|
|
||||||
|
|
||||||
// Close and output PDF document
|
|
||||||
// This method has several options, check the source code documentation for more information.
|
|
||||||
$pdf->Output(APPPATH."/docs/sample.pdf", 'F');
|
|
||||||
|
|
||||||
|
|
||||||
//PDF GEN BY TCPDF
|
|
||||||
die();
|
|
||||||
$output_file2 = APPPATH."/docs/sample.pdf";
|
$output_file2 = APPPATH."/docs/sample.pdf";
|
||||||
echo file_put_contents($output_file2, $pdf->Output(APPPATH."/docs/sample.pdf", 'F'));
|
echo file_put_contents($output_file2, $pdf_doc);
|
||||||
|
|
||||||
// echo $ci_instant;
|
// echo $ci_instant;
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
@ -3,20 +3,25 @@
|
|||||||
|
|
||||||
|
|
||||||
include_once APPPATH.'/vendor/autoload.php';
|
include_once APPPATH.'/vendor/autoload.php';
|
||||||
define('DOMPDF_ENABLE_AUTOLOAD', false);
|
//define('DOMPDF_ENABLE_AUTOLOAD', false);
|
||||||
include_once APPPATH.'/vendor/dompdf/dompdf/dompdf_config.inc.php';
|
//include_once APPPATH.'/vendor/dompdf/dompdf/src/autoloader.php';
|
||||||
//require_once("./vendor/dompdf/dompdf/dompdf_config.inc.php");
|
//require_once APPPATH.'/vendor/dompdf/dompdf/src/autoloader.php';
|
||||||
//use dompdf\dompdf\dompdf_config.inc;
|
// require_once APPPATH.'/vendor/dompdf/dompdf/lib/html5lib/Parser.php';
|
||||||
//use dompdf\dompdf;
|
// //require_once APPPATH.'/vendor/dompdf/dompdf/lib/php-font-lib/src/FontLib/Autoloader.php';
|
||||||
// use Amp\Loop;
|
// //require_once APPPATH.'/vendor/dompdf/dompdf/lib/php-svg-lib/src/autoload.php';
|
||||||
|
// require_once APPPATH.'/vendor/dompdf/dompdf/src/Autoloader.php';
|
||||||
|
// require_once APPPATH.'/vendor/dompdf/dompdf/src/Dompdf.php';
|
||||||
|
// require_once APPPATH.'/vendor/dompdf/dompdf/src/Adapter/CPDF.php';
|
||||||
|
// Dompdf\Autoloader::register();
|
||||||
|
|
||||||
|
use Dompdf\Dompdf as Dompdf;
|
||||||
class Pdfgenerator
|
class Pdfgenerator
|
||||||
{
|
{
|
||||||
|
|
||||||
public function generate($html, $filename='', $stream=TRUE, $paper = 'A4', $orientation = "portrait")
|
public function generate($html, $filename='', $stream=TRUE, $paper = 'A4', $orientation = "portrait")
|
||||||
{
|
{
|
||||||
// echo 'stream'.$html.'tttt';
|
// echo 'stream'.$html.'tttt';
|
||||||
$dompdf = new DOMPDF();
|
$dompdf = new Dompdf();
|
||||||
$dompdf->load_html($html);
|
$dompdf->load_html($html);
|
||||||
$dompdf->set_paper($paper, $orientation);
|
$dompdf->set_paper($paper, $orientation);
|
||||||
$dompdf->render();
|
$dompdf->render();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user