I am currently working on generating a PDF. My goal is to remove the last page using CSS methods. I have attempted to use :last-child
to achieve this, but unfortunately, it did not yield the desired results.
Here is an excerpt of my code:
body {
font-family: 'Roboto', sans-serif;
font-size: 0.85em;
padding-left: 30px;
padding-right: 30px;
line-height: 0.95em;
}
@font-face {
font-family: 'Roboto', sans-serif;
font-style: normal;
font-weight: normal;
}
footer {
position: fixed;
bottom: -30px;
right: 0px;
height: 50px;
width: 270px;
text-align: left;
}
footer .page-number:after {
content: counter(page);
}
footer .page-number .last:last-child {
display: none
}
<body>
<footer>
<div class="right" style="margin-left: -85px;">
<span class="page-number"></span>
</div>
<table width="100%" class="last">
<tr>
<td>
<span style="
border: 1px solid;
box-sizing: border-box;padding-right: 0.88cm;padding-left: 5px;vertical-align: middle;">Roles I </span>
<span style="width: 300px;
border-top: 1px solid;
border-right: 1px solid;
border-bottom: 1px solid;
margin-left: -6px;
box-sizing: border-box;padding-right: 70px;vertical-align: middle;">     </span><br>
<span style="
border-left: 1px solid;
border-right: 1px solid;
border-bottom: 1px solid;
box-sizing: border-box;padding-right: 1.32cm;padding-left: 5px;vertical-align: middle;">Roles II</span>
<span style="width: 300px;
border-right: 1px solid;
border-bottom: 1px solid;
margin-left: -6px;
box-sizing: border-box;padding-right: 70px;vertical-align: middle; ">     </span>
</td>
</tr>
</table>
</footer>
My content here until Nth Page and my objective is to remove the content in the red box at the footer
</body>
In the provided example image, you can see that there are a total of 3 pages, with numbers and boxes highlighted in red within the footer. I specifically aim to delete the data within the red boxes while retaining the page numbers. https://i.sstatic.net/4Vsk2.png
Note: I am utilizing the dompdf library for this task