Content Duplicating for inline html styling

Hi Aspose,

I having an issue when generate pdf using inline html string.
This happen on below attached html file.
InputHtmlFile.zip (5.2 KB)

Code snippet

    public static byte[] GetPdfFromHtml(string htmlString, string mediaPath, string fileName)
    {
        // Get the license
        var asposeLicenseFileName = @"~\Asserts\Aspose.Total.lic";
        if (!string.IsNullOrEmpty(asposeLicenseFileName))
        {
            try
            {
                // instantiate the license class
                var license = new License();
                //pass only the name of the license file embedded in the assembly
                license.SetLicense(asposeLicenseFileName);
            }
            catch (Exception ex)
            {
                // run as evaluation if this fails 
            }
        }

        var objLoadOptions = new HtmlLoadOptions(mediaPath);
        objLoadOptions.PageInfo.Margin.Bottom = 10;
        objLoadOptions.PageInfo.Margin.Top = 30;
        objLoadOptions.PageInfo.Margin.Left = 10;
        objLoadOptions.PageInfo.Margin.Right = 10;

        var doc = new Document(new MemoryStream(Encoding.UTF8.GetBytes(htmlString)), objLoadOptions);
        doc.Info.Title = fileName;
        var emptyPageNumbers = new List<int>();

        for (var pageNo = 1; pageNo <= doc.Pages.Count;)
        {
            if (doc.Pages[pageNo].IsBlank(0.01d))
            {
                emptyPageNumbers.Add(pageNo);
            }
            pageNo++;
        }

        if (emptyPageNumbers.Count > 0)
        {
            //Remove Empty Pages
            doc.Pages.Delete(emptyPageNumbers.ToArray());
        }

        // Return bytes
        using (var ms = new MemoryStream())
        {
            doc.Save(ms, SaveFormat.Pdf);
            return ms.ToArray();
        }
    }

Output result
My-Sample-20210310100331.pdf (188.0 KB)

Can you please help to solve this.

Please let me know if you needed more details to investigate this issue.

Thanks,
Iresha

@iresha

We were able to reproduce the issue in our environment while using Aspose.PDF for .NET 21.2. Therefore, have logged it as PDFNET-49596 in our issue management system for the purpose of rectification. We will further work on resolving this issue and update you as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi @asad.ali,
Any update on this ?.

@iresha

The earlier logged ticket has already been escalated to the high priority. It is being investigated at the moment and you will surely be notified as soon as it is fixed. Please give us some time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFNET-49596) have been fixed in Aspose.PDF for .NET 21.4.