Hello,
I am trying to skip the header and footer for the first page of the report it's working but how to do it with HTML or in view. If I am trying to pass HTML into return then it's not working.
Below is my code:
$headerContent = '<div class="page-header" style="height:80px; margin-right: 0px; padding: 0px;">
<div style="color:#333333; width:100%; font-size:12px; border-bottom:1px solid #666666; padding-bottom:5px; height: 50px;">
<div style="float: left; text-align:left; width:70%; padding-top:2px; padding-bottom:10px; height:40px;">
<strong style="font-size:16px; color:#000000;">Title</strong><br>
<span style="font-size:11px; color:#333333; font-style: italic;">Report Date </span>
</div>
<div style="float: right; width:30%; padding-top:8px;">
<a style="float:right;"><img src="'.$imgURL.'" style="float:right; min-width:40px; max-width:100px; max-height:50px; margin-right: 2px;"></a>
</div>
</div>
</div>';
$report->export('Template_View')
->pdf(array(
"width"=>"1024px",
"height"=>"768px",
"headerCallback" => "function(headerContent, pageNum, numPages){
if (pageNum == 1) return '';
return '$headerContent' || headerContent;
}",
"footerCallback" => "function(footerContent, pageNum, numPages){
if (pageNum == numPages) return ''; //don't return any footer for the last page
return footerContent;
}"
)
)->saveAs($pdfPath);
Please explain how can we do it and how can we do it using view only.