Free Support Forum - aspose.com

Saving pdf from an html file having table rows overlap issues

Hi,
I have an html template that I use to generate html on the run in .net core 3.1. The html renders fine. But when I save that html as pdf using Aspose.PDF, the table will show overlapping of rows if the number of rows is more than 15. This is the code I use to convert HTML file to pdf

Document pdfDocument = new Aspose.Pdf.Document(generatedHTMLFilePath, options);
pdfDocument.Save(outputPdfFile);

The options definition is
HtmlLoadOptions options = new HtmlLoadOptions();
options.PageInfo = new PageInfo();
options.PageInfo.Width = 597.6;
options.PageInfo.Height = 842.4;
options.PageInfo.IsLandscape = false;
options.PageInfo.Margin = new MarginInfo();
options.PageInfo.Margin.Left = 18.00;
options.PageInfo.Margin.Right = 18.00;
options.PageInfo.Margin.Top = 18.00;
options.PageInfo.Margin.Bottom = 18.00;
options.HtmlMediaType = HtmlMediaType.Print;

Can you please help with fixing the overlapping rows? The table definition in the template is:

        <th>Product</th>
        <th>Region</th>
        <th>MOS</th>
        <th>Estimate #</th>
        <th>Description</th>
        <th>Invoice #</th>
        <th>Invoice Amount Due</th>
    </tr>
    {{#each ConsolidatedInvoiceMappings}}
    <tr>
        <td>{{../ProductName}}</td>
        <td>{{../Region}}</td>
        <td>{{BillingMonth}}</td>
        <td>{{EstimateId}}</td>
        <td>{{EstimateDescription}}</td>
        <td>{{{ InvoiceNumber}}}</td>
        <td>{{{ formatCurrency InvoiceAmount}}}</td>
    </tr>
    {{/each}}

</table>

Thanks in advance for any help.

@sambarish

Please share the problematic input HTML file as well. You can zip the file and attach with this thread. We need to reproduce the same issue at our end with your input file to be able to help you out in resolving the issue.