I am using the wkhtmltopdf package to convert my html page to a .pdf file. I want to use this so that customers can print content on paper with a tag removed 3 x 7. The exact label size is 70 x 42.3 mm. The problem is that I cannot correctly determine the size.
I used css float right and 33% width to get 3 columns, and now I'm trying to get 7 rows. I thought that dividing it by 14.2% (7 rows) would do the trick. However, after that only 1 mark will be printed. When I delete the height, it will print all the labels, but more than 7 per page. Can someone help me figure out how to get the 3x7 a4 format for shortcuts?
{% set labels = 1 %}
{% block body %}
{% for sale in webstore.getSales %}
{% for orderItem in sale.getOrderItems %}
{% if labels == 21 %}
<div style="page-break-after: before;" class="newPage"></div>
{% set labels = 1 %}
<br>
</div>
{%endif%}
<div class="stickerWidth" id="stickerWidth" >
<div class="text">
<div >{{sale.getWebstoreOrderId}} : <span style="float:right; margin-right:5px; font-size:20px" > {{sale.getDate.date | date("d/m/Y")}}</span> </div> <br><br>
<div style=" text-align:center;font-size: 24px;">{{orderItem.getAmount}} x {{orderItem.getItemName}}</div> <br>
<div>
{% if webstore.name %}
<span style="font-size:20px">
{{webstore.id}}<br>
{{webstore.name}}</span>
{% endif %}
</div>
</div>
</div>
{% set labels = labels + 1 %}
{% endfor %}
{% endfor %}
{% endblock %}
{% block styleSheets%}
<link rel="stylesheet" href="{{ base_dir ~ asset('css/main.css') }}">
<style>
.newPage {
page-break-after: always;
page-break-inside: avoid;
}
.stickerWidth{
height: 180px;
width: 33%;
float: left;
background-color: green;
}
.text{
background-color: red;
margin-right: 5px;
margin-top: 5px;
margin-top: 5px;
}
</style>
{% endblock %}
EDIT: last code added, tags are used for counting, if I reached 21, then a new page
