It looks like a defect was introduced in the 25.2.* versions of the EO.pdf nuget package when the current thread culture is set to certain Arabic culture codes and PdfDocument.Merge() is called. Steps to reproduce:
1. Create a .NET full framework (4.8) console application
2. Add any of the 25.2.* EO.pdf nuget packages to the project
3. Add this code snippet:
Code: C#
var pdfResults = Enumerable.Range(0, 5).Select(i =>
HtmlToPdf.ConvertHtml($"<!DOCTYPE html>\r\n<html>\r\n<head>\r\n<meta charset=\"utf-8\"></head><body>{i}</body></html>", new PdfDocument()));
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ar");
var merged = PdfDocument.Merge(true, pdfResults.ToArray());
merged.Save("result.pdf");
4. Running this code will throw this exception:
System.ArgumentOutOfRangeException: 'Specified time is not supported in this calendar. It should be between 04/30/1900 00:00:00 (Gregorian date) and 11/16/2077 23:59:59 (Gregorian date), inclusive.
Parameter name: time'
A couple other notes:
- The exception is not thrown if we downgrade to a 25.1.* nuget version
- The exception was thrown with code "ar", but not with code "ar-eg".
- The exception was not thrown with a .NET 8 console app
Can you confirm this defect and provided a timeline on when it may be fixed?