问题
I have a problem with generating a page break in the Itext7. Environnement:
- Visual Studio 2017 C#
- Version itext7 core: 7.0.2.2 [Trial License atm]
- Version itext7.pdfhtml: 1.0.0.2
Flow to generate my PDF:
- Use of RazorEngine to parse my model with my cshtml
- Create a doc and writer
- Use of
iText.Html2pdf.HtmlConverter.ConvertToPdf(msHtml, writer);
=> mshtml is the memory of my generated html in step 1
Stackoverflow Questions i've tested
Suggested solution 1:
is for php...
Page break in Html2Pdf
=>not planning on changing my nuget package
Suggested solution 2:
is for php...
https://stackoverflow.com/a/21773395/5625156 => not working => are there any restrictions where to use these tags? Can you use them inside a div ,...?
Suggested solution 3:
Use page-break-before: always
: Worked in itext5 but not in the itext7
Any other suggestions for the break? Or is this an issue?
Update 1: My page break code in my *.cshtml
// Worked like this in itext5
<div style="page-break-before: always;">
// table
</div>
来源:https://stackoverflow.com/questions/43674882/page-break-in-itext7-in-method-htmltopdf