Page break in Itext7 in method htmltopdf

你。 提交于 2019-12-25 07:41:39

问题


I have a problem with generating a page break in the Itext7. Environnement:

  1. Visual Studio 2017 C#
  2. Version itext7 core: 7.0.2.2 [Trial License atm]
  3. Version itext7.pdfhtml: 1.0.0.2

Flow to generate my PDF:

  1. Use of RazorEngine to parse my model with my cshtml
  2. Create a doc and writer
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!