0

HTML -> PDF. How can I render an unknown number of empty rows, from the last row with data until reach footer? you can see the issue here. The issue is that sometimes rows in the data part will be single-row, sometimes multi-row. My tries:

  1. in razor @for(int i = 0; i < 70; i++) {...} - and try to crop rows that go to next page with "overflow-y:hidden"
  2. setting "height:auto" for the last row (without for loop), so it can fit remaining space, and then set background (that will look like alternated rows) for that row
  3. https://www.evopdf.com/demo/HTML_to_PDF/Headers_and_Footers/Header_Footer_Auto_Resize.aspx. In this try alternated lines were part of the footer, so I try to dynamically adjust its height
  • The solution, but not ideal: # of rows on 1 pdf page is for example 25, so # of empty lines will be 25 - # of rows with data. If data goes to the 2nd page, then 50 - # of rows with data and so on. Not ideal, because some data will be multi-line, so height will not be equal for all rows. So I put 2 less empty lines like buffer – Vladimir Krasko Aug 06 '20 at 17:29
  • also, answer form evoPdf is that I can't achieve this behavior with their library. Guy suggests htmlToPdfConverter.PdfDocumentOptions.SinglePage = true, but that solution wasn't good for us. – Vladimir Krasko Aug 06 '20 at 17:31

0 Answers0