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.