Vote count:
0
<?php if(file_exists("./dompdf/dompdf_config.inc.php") && include("./dompdf/dompdf_config.inc.php")){
// some code will be here
}
$new_path = realpath('./');
$new_p =split('[/]',$new_path);
for($i=0; $i<count($new_p)-2; $i++)
{
$str1= $str1.$new_p[$i];
$str1= $str1."/" ;
}
$str1= $str1."PDF/Report_Pdf/AAR_Pdf.pdf";
$currentDate = date("d-m-Y");
echo $rv_no;
$html_data ='<html>
<head>
<link href="../../css/myTable1.css" rel="stylesheet" media="screen" /></head>
<body style="margin-top:0px; margin-bottom:0px;margin-left:0px;margin-right:0px">
<div style="text-align:left;">
<table class="Mytable1" style="width:100%;font-size:0px;margin-left:50px;width:1800px" width="1000px" height="800px">
</thead>
<tbody>';
$html_data=$html_data.$_REQUEST['html_cont'];
$dompdf = new DOMPDF();
$dompdf->set_paper("a4", "landscape");
$dompdf->load_html($html_data);
$dompdf->render();
$canvas = $dompdf->get_canvas();
$canvas->page_text(16, 800, "Page: {PAGE_NUM} of {PAGE_COUNT}", $font, 16, array(0,0,0));
$canvas->page_text(900, 800, "Date: {$currentDate}", $font,16, array(0,0,0));
/*
$canvas = $dompdf->get_canvas();
$font = Font_Metrics::get_font("helvetica", "bold");
$canvas->page_text(16, 800, "Page: {PAGE_NUM} of {PAGE_COUNT}", $font,16, array(0,0,0));
$canvas->page_text(900, 800, "Date: {$currentDate}", $font,16, array(0,0,0));*/
// tde next call will store tde entire PDF as a string in $pdf
$pdf = $dompdf->output();
echo $pdf ;
//$font = Font_Metrics::get_font("helvetica", "bold");
//$pdf->page_text(72, 18, "Header: {PAGE_NUM} of {PAGE_COUNT}", $font, 6, array(0,0,0));
// You can now write $pdf to disk, store it in a database or stream it
// to tde client.
$str1= "../../PDF/Report_Pdf/AAR_Pdf.pdf" ;
file_put_contents($str1, $pdf);
?>
asked 46 secs ago
dompdf a4,landscape size is not working
Aucun commentaire:
Enregistrer un commentaire