Exceptions System.InvalidOperationException when converting HTML to PDF

Hi,

I’m encountering multiple exceptions when converting a HTML page to a PDF document.
Because of the obfuscation, I’m not able to understand why I get the following exceptions : System.InvalidOperationException: 'Unsupported format 1 for lookup type: 1'

image.png (30,0 Ko)

Here is a sample to reproduce the exception with the latest version of Aspose.PDF 23.11.1

string html = @"<!DOCTYPE html>
<html lang=""fr"">
<head>
    <meta http-equiv=""Content-Type"" content=""text/html charset=UTF-8"" />
    <title>Title</title>
</head>
<body>
<p>test</p>
</body>
</html>";
TestGenerationPdf(html, "test.pdf");
private static void TestGenerationPdf(string html, string pdfPath)
{
    HtmlLoadOptions options = new HtmlLoadOptions();
    options.HtmlMediaType = HtmlMediaType.Print;
    options.PageInfo.Width = PageSize.A4.Width;
    options.PageInfo.Height = PageSize.A4.Height;
    using (MemoryStream mstrem = new MemoryStream(Encoding.UTF8.GetBytes(html)))
    {
        using (var pdfDocument = new Document(mstrem, options))
        {
            pdfDocument.OptimizeResources();
            pdfDocument.Save(pdfPath);
        }
    }
}

Thanks in advance for your help !

@nbeaudrot

We were unable to replicate the issue in our environment. For your kind reference, attached is the output PDF.
output.pdf (75.4 KB)

Can you please share your environment details like .NET framework, OS Name, etc?

Thanks for testing, I’m also able to generate the PDF, the exception didn’t stop the generation but with a bigger HTML file, it throw hundred of exceptions wich slow down the generation.

Environment details :

  • OS : Windows Version 10.0.19045 Build 19045
  • .Net framework : .Net 4.8

@nbeaudrot

Can you please share such HTML file which can be used to replicate the exception. It is important for us to have a sample HTML so that we can investigate and address the issue accordingly.

Sure, I understand but I thought that I was able to reproduce the bug with the sample HTML I gave you in the first post but I was wrong, sorry about that.
Using the following code, I got 2 exceptions of the same kind :

        private static void GetPdfBulletin(string pdfPath)
        {
            HtmlLoadOptions options = new HtmlLoadOptions();
            options.HtmlMediaType = HtmlMediaType.Print;
            options.WarningHandler = new WarningHandler();
            options.PageInfo.Width = PageSize.A4.Width;
            options.PageInfo.Height = PageSize.A4.Height;
            options.PageInfo.Margin = new MarginInfo(0, 187, 0, 0);
            options.DisableFontLicenseVerifications = true;
            options.IsEmbedFonts = false;

            var html = @"<!DOCTYPE html>

<html lang=""fr"">
<head>
    <meta http-equiv=""Content-Type"" content=""text/html charset=UTF-8"" />
    <title>Bulletin</title>
    <style>
        h1, h2, p, img, tr, th, td {
            margin: auto;
            font-size: 0pt;
            padding: 0px;
        }

        h1, h2, tr, th, td, p {
            font-family: Calibri;
        }

        table, tr, th, td {
            border-collapse: collapse;
            page-break-inside: avoid;
        }
    </style>
</head>
<body>
    <table style=""width: 785px; position: relative; bottom: 9px;"">
        <tr>
            <td style=""vertical-align: top; text-align: left;"">
                <img src=""data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAu0AAABBCAYAAABl/5rbAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwQAADsEBuJFr7QAAJlJJREFUeF7tnYljFUW2/39/xvu9mfd+7zeC47iBgIAIBNkFFBFBBBFBFEVkEXGDUUQcdUYRxRlXdhUcJRvZSAgkJCH7DoGQBUISsgBJyB6ynFff0103naYTEkggNzmfeecl3Kququ6bmE/XPVX9f0gQBEEQBLfjSPEFGh4aSAMDvWiA728SEhJ9MAb6e9Lgw/7kU5BHIu2CIAiC4Ia0tLTQD9mZ9JfggzTg4O+Of/AlJCTcONTv9Z2B3vTJqXT+fRdpFwRBEAQ3pbrxKq1KjKWBh3xE3CUk+lgMPORLi2MiqaSuln/fRdoFQRAEwY3Jraqk2cfD+A+80x9+CQkJ9wukvU0OD6GMygrzN12kXRAEQRDcnoiLxTQiNEDy2yUk+kAgj/2B4IOcx25FpF0QBEEQ+gA/ncume5Emo/7gO4mAhISEG8TB3+kvQT607UwGNVOL+dttINIuCIIgCH2AhuZm+uhEipHf7iQDEhISvTuUsA8M9KY1yXG8XsWOSLsgCIIg9BHK6uvolaRoEXcJCXcM9Xu7IPoYXaitMX+j2yLSLgiCIAh9iOyqSnoyShamSki4U2CG/ZEjQZRWcdn8Tb4WkXZBEARB6GMkl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eu0P1dW+AF3mEBtGsqHB6OT6KPkhPoh+zT1NI0QXKqaqkKnWewu2nX0o7sEurtfxmpB3Y00oQ7aXGgI6k3WnG2h52qbYLs13aAcS9M+eJc7ELO+jM+2Kf0RdpFwRBEPo69c3NdLG+jnIqKymp7DIFFJ5nAd58MpVeT46lRdERnC//8CE/GqqkfnCAN92nvt6txBkPg8IM9wAshsX3ZnA+fQfRWteQcuyBfrdq9151ozAowIeGBPnSqOCDND0smBbFHKM1yfG0SY3nu6zT5FeQRwmXL7Kcl9bVUV1Tk3kmQm+j30q7XWyt6R83K+1O6SftpcZcD8g1PhmA9NvHhTGjr/Zy3jsDrgPatt5o4CYAnz5Yc9jtdOZ9sc/oi7QLgiAI/Z3mlhaeoS9raKCC2hpKLb9MUaUldOhCAf2ed5Z25ZxRkn+Gtmae5DQcPN31/dQk2piWfE28n5ZEnyj5/ur0SfoyM4N+yM6k3Wez6Lfz5yhItRep2k0rL6O8mmruD3n62PZScEeI/hcKrlvdMZAjsQAAAABJRU5ErkJggg=="" alt=""Entete"" />
            </td>
            <td style=""padding-left: 16px; padding-bottom: 25px;"">
                <img src=""data:image/png;base64, iVBORw0KGgoAAAANSUhEUgAAAEAAAAAPCAIAAADbBV4wAAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAAOwAAADsABataJCQAAAylJREFUSEu1ltlvElEUxv07u9nNVhPbBxNj9MEHo8akvjapUaOJL6aJaau29qEuka2dGdZCW6DADBQYZtgKDJRh8xsOUEqB1hS+nFwGcufe73fOuTfcqtVVqVYx/pSio4x+3rJ7x2zqGjOs8eYxy2njNGtYcR9tCcH1AL/BCxTrPP9dCJpFyRqTLWK/wARMk3JKA0CzX6tlSuoTp/U2a+jDMJCYM5umOMNzl30TAE33iDWe/xuJOuSETYr3CbsUt0pxZzypVioNAIiK8EcSx1nD3PABpjnjopVZ9fu/NRlQCvAgtR12LwcAzKIsZLIwfA5ARVCr1SWPa4zR3x0+wyRneHWwvyWEGgC8YIzGHJfsdoSW/piMKimlEgyfA0BUBEHJLViZKc441EYCwGx9fO/1bAdDawH+10nYfo3mwWiOyVI+T54vAEDEYExIE2gkbDBkBq2RbMxHr/eHEEJeyV+vaLgX5XBWgUlqmU4AqFxn+BoJoZHmLKah1uGeZW+E0T07sHuSaQtuniZDi6T9KxKPsysqebJO6gIAVesMX8LCGKtHoYfEgGM2zugfOjheyWE7KV84iCfBAKMEQ4GvZP04fZpTtb5vVw8AjUF72Iye4Fad5IyDPdNonnmLaWRP99Rlixa0bqaUlSrVZOEsmMl6U+nDRMoVT7qTKfiOZJVsUdUMNTunpe4AEObReTAl5EUbi3ZCHW5eClhHLmY4IxZc9h2l1SK2oKZtd4atcccXyxUgtf/e/kzqCUCi10N55bXHNc7qUQ0ca2DAR4ezK2PerL2IhoT1+1ZmWwyTm4sOuwszek26AgCiDZAkXTz22GnF7YRACqkg/UnqrbKLlOMBt/4oowPGG79HPCs0Fu9p7Lq6GgACA+2jlEs7seiLQwfMje7pcARBQi7hDEZbQXjI9ySr+Z5g9A/s3LuA15vN1Fc6X/OGuhYAqZWtfLnsPE2vnvAvj/YXbAwsjjE6BP4I0kgPwAPno33Lss/9WxYj9cMKDco66T8AIGzcXnSQwJbjNLUTi3wOBT7wxys+99uA55Pg34iEdhOyL5dJqUU6oxA+BmhdU632D2hSNmsNUv6/AAAAAElFTkSuQmCC"" />
            </td>
        </tr>
    </table>

    <footer />
</body>
</html>
";
            using (MemoryStream mstrem = new MemoryStream(Encoding.UTF8.GetBytes(html)))
            {
                using (var pdfDocument = new Document(mstrem, options))
                {
                    pdfDocument.OptimizeResources();
                    pdfDocument.Save(pdfPath);
                }
            }

        }

It looks like the way we are displaying images, using base64 code throw an exception for every images.
Using .Net 4.8, VisualStudio 2022 and Windows 10, it gives me the following exception :
image.png (97,9 Ko)
I thought that it was safer to add the image directly in the html to avoid path trouble while converting HTML document, but maybe I was wrong ?

Thanks for your help

@nbeaudrot

We could not notice this exception as well in our environment using new HTML string that you shared. Attached is the output file.
output.pdf (17.5 KB)

Can you please make sure that you are using 23.11 version of the API because we are testing using the latest version.