Closed l0pest closed 4 years ago
Sorry. I found a solution.
There were no problems from the beginning.
My HTML document was the problem.
The last blank page was solved in the following way.
<c:choose>
<c:when test="${loop.index == totalPageSize }">
<div style="page-break-after:auto;">page ${loop.index } / ${totalPageSize}</div>
</c:when>
<c:otherwise>
<div style="page-break-after:always;">page ${loop.index } / ${totalPageSize}</div>
</c:otherwise>
</c:choose>
Converting the URL to PDF creates a blank page on the last page. How do I prevent a blank page from being added?
boolean success = HtmlToPdf.create() .pageSize(PdfPageSize.A4) .object(HtmlToPdfObject.forUrl(url)) .convert(pathPC);