|
Queries |
Response | |
|
The header displays on the first page even though no rows are displaying and then repeats on the second page. It should skip the first page altogether if there's not at least one content row. |
We have analyzed the provided sample, but we could not prevent this header skip issue in our end. The content HTML will be rendered with available space on the first page so that the table header is started on the first page, then the table row was not fit on the first page, it will automatically be moved to the next page.
To overcome this issue, we can adjust the HTML content size in the PDF document by using viewport size. Based on the provided size, the content will be scaled in the PDF document. Please try the below viewport settings in your sample and let me know the result.
| |
|
Rows starting with "Data Set A" and "Data Set B" are in different tbody tags which I'm expecting to break and display on different pages by using page-break-inside: avoid; and given not all records of "Data set B" fit on the same page. |
We have checked this page break issue, we canpage-break properties apply only to block-level elements so that you are not getting page-breaks on <tbody>. To overcome this, you have to apply page-break to a block-level pseudo-element on the <tbody> instead of directly applying it to tbody.
However, we have to define proper page-context and appropriate margins and dimensions. Please try the above solutions at your end and let me know your result. |
|
BlinkConverterSettings settings = new BlinkConverterSettings
{
EnableJavaScript = true,
Margin = new PdfMargins { Top = 20, Bottom = 20, Left = 20, Right = 20 },
Orientation = PdfPageOrientation.Portrait,
ViewPortSize = new Size(1200, 0),
PdfPageSize = PdfPageSize.A4,
MediaType = MediaType.Print,
}; |