Welcome Guest Search | Active Topics | Sign In | Register

Defect - EO.pdf HtmlToPdfOptions.GenerateTags=true creates corrupt PDF Options
Talogy Development
Posted: Tuesday, November 5, 2024 12:53:30 PM
Rank: Newbie
Groups: Member

Joined: 5/24/2019
Posts: 5
We have a .NET 4.8 application that is converting HTML to PDF. It looks like a defect was introduced in the EO.pdf nuget package versions 24.2.54 and greater that causes the generated PDF to not be able to be opened in Adobe Acrobat when the HtmlToPdfOptions.GenerateTags property is set to true. A very basic 4.8 console app with this code can reproduce (note the HTML markup is getting encoded by this editor but is correct):

Code: C#
static void Main(string[] args)
{
    EO.Pdf.Runtime.AddLicense(
       "omitted");

    var result = HtmlToPdf.ConvertHtml($"<html dir=\"ltr\" lang=\"en\"><head></head><body>Testing</body></html>", 
        new PdfDocument(), 
        new HtmlToPdfOptions()
        {
            GenerateTags = true
        });

    // Save PDF to stream
    using (var stream = new FileStream($"result_{DateTime.Now.Ticks}.pdf", FileMode.OpenOrCreate))
    {
        result.PdfDocument.Save(stream);
    }
}


The PDF opens fine in Chrome and Firefox, but in Acrobat an error dialog shows when trying to open the file. I tested a few older versions of the nuget package, and 24.2.29 and 24.1.93 render valid PDF files. If you run the Preflight check in Acrobat Pro on the PDF, several errors are detailed.

This is a pretty serious defect as we'd already generated several thousand PDFs for customers after our latest software release before the Acrobat issue was noticed.
eo_support
Posted: Tuesday, November 12, 2024 3:42:35 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,245
Thanks for letting us know. We were able to find the root cause of this issue and this will be fixed in our next build, which should come out late this month. If you need a build sooner, please PM us and we will see if we can create an internal build for you.
eo_support
Posted: Wednesday, November 20, 2024 12:48:12 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,245
Hi,

This is just to let you know that we have just posted a new build that should resolve this issue. Please download it from our download page and see if it works for you.

Note that this is the initial 2025 build. So you would need to go to your license key page to get a new v25 license key in order to use this build.

Please feel free to let us know if you still see any problems.

Thanks


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.