Attempting to generate an invoice using Razor template and then converting it into a PDF through chromium. The challenge is adding a payment form to the last page in a fixed position.
.svg-container {
position: absolute;
top: 12cm;
left: 0cm;
left: 0px;
width: 18cm;
height: 10cm;
}
<div class="svg-container">
<svg>..</svg>
</div>
Following this method, the payment form SVG ends up in the correct place but unfortunately overlaps with the invoice area on the first page.
<div style="position: relative;">
<div class="svg-container">
<svg>..</svg>
</div>
</div>
When the payment form is placed after the invoice data using this approach, its position becomes variable. One solution could be setting an absolute position with the 'top' property calculated from:
AbsoluteTop = TopOfPage + pages * PageHeigth;
The challenge lies in retrieving the page count within the Razor code and setting the 'top' value dynamically:
WriteLiteral("style =\"top: " + @razorVariablePAges + ";\"")
Within the header section, the following is used:
<span class='totalPages' style="font-family:Arial; font-size:7pt ">
However, accessing this information as a Razor variable proves to be difficult.