fixing pagenumber

This commit is contained in:
KhatamNugraha
2024-04-18 17:43:01 +07:00
parent b7dd8991ed
commit a83687692a
2 changed files with 250 additions and 248 deletions

View File

@ -474,9 +474,17 @@
$pages = array_filter($objects, function($v) { $pages = array_filter($objects, function($v) {
return $v['t'] == 'page'; return $v['t'] == 'page';
}); });
$number = 1; $number = 1;
$no = 0;
$noSurat = $infoSuratNew['no_surat'] ; $noSurat = $infoSuratNew['no_surat'] ;
foreach($pages as $pageId => $page) { foreach($pages as $pageId => $page) {
$nos = $page['info']['pageNum'];
$canvas->reopen_object($pageId + 1);
$canvas->text(502, 780, "Page : ". $nos, $font, 10, array(0,0,0));
$canvas->close_object();
$number++;
if(($pageId + 1) !== $firstPageId) { if(($pageId + 1) !== $firstPageId) {
$canvas->reopen_object($pageId + 1); $canvas->reopen_object($pageId + 1);
$canvas->text(350, 50, "Lanjutan Surat No : $noSurat", $font, 10, array(0,0,0)); $canvas->text(350, 50, "Lanjutan Surat No : $noSurat", $font, 10, array(0,0,0));

View File

@ -54,15 +54,14 @@
} }
.footer { #footer {
width: 100%;
text-align: center;
position: fixed; position: fixed;
margin-top: 1cm; left: 20px;
top: 23cm; bottom: 0;
font-size: 12px; text-align: center;
}
#footer .page:after {
content: counter(page);
} }
/* .header { /* .header {
@ -72,7 +71,7 @@
left: 0px; left: 0px;
right: 0px; right: 0px;
height: 50px; height: 50px;
font-size: 20px !important; font-size: 20px !important;dsdas
background-color: #000; background-color: #000;
color: white; color: white;
text-align: center; text-align: center;
@ -83,14 +82,14 @@
/* body:nth-child(1) .header { /* body:nth-child(1) .header {
display: none; display: none;
} */ } */
/*
.pagenum:before { .pagenum:before {
content: counter(page); content: counter(page);
} } */
.flyleaf { /* .flyleaf {
page-break-after: always; page-break-after: always;
} } */
@ -98,7 +97,7 @@
</head> </head>
<body> <body>
<main>
<ul class="no-bullets"> <ul class="no-bullets">
<li>Nomor &nbsp; : {{$data['infoSuratNew']['no_surat']}}</li> <li>Nomor &nbsp; : {{$data['infoSuratNew']['no_surat']}}</li>
<li>Tanggal : {{ $data['today'] }}</li> <li>Tanggal : {{ $data['today'] }}</li>
@ -231,10 +230,6 @@
@endif @endif
</tbody> </tbody>
</table><br> </table><br>
<ul class="no-bullets" style="page-break-inside: avoid;"> <ul class="no-bullets" style="page-break-inside: avoid;">
<li>FASILITAS LAIN YANG DITERIMA OLEH NASABAH</li> <li>FASILITAS LAIN YANG DITERIMA OLEH NASABAH</li>
<li>POSISI : {{ $data['batchDate'] }} </li> <li>POSISI : {{ $data['batchDate'] }} </li>
@ -346,9 +341,8 @@
</tr> </tr>
</table> </table>
</div> </div>
<div class="footer"> </main>
Page <span class="pagenum" style="margin-top:100px"></span>
</div>
</body> </body>
</html> </html>