We are observing a potential issue with the EO.Pdf library for .NET C#. We are currently using a licensed v15.3.31.0 in our production environment, but the issue also seems to exist in the latest version v17.2.43.0.
To elaborate, the library works quite well for our purposes and we are only observing the issue with some PDF files.
In our product, the flow is such that PDFs are available in the process memory as bytes, from which "stream" objects are created and passed to the stream-based PdfDocument constructor. The intention is to eventually pass the PdfDocument objects to the Merge() method for stitching them together. We get a NullReferenceException in the stream-based PdfDocument constructor.
To demonstrate the issue, I have prepared a simple application in which PDFs are read from the file-system and constructed as PdfDocument objects, which are then passed into the Merge() method. In this case too, we get a NullReferenceException in the PdfDocument constructor for some files.
I found a seemingly similar issue discussed on the forums quite some time ago:
https://www.essentialobjects.com/forum/postst9304_SystemNullReferenceException-on-Merge-of-array-of-Pdf-Documents.aspxHowever, ours might be new issue because we have tried with the latest version too.
We cannot publicly share the PDF files that are causing the issue but we can share the sample project and PDF files privately with your support team.
Exception with v15.3.31.0
at EO.Internal.pd.d()
at EO.Internal.aap.a(f5 A_0)
at EO.Internal.f5.a(akw A_0)
at EO.Internal.f5.a(Stream A_0, Boolean A_1, Boolean A_2)
at EO.Internal.f5.a(String A_0)
at EO.Internal.f5..ctor(String A_0, PdfDocumentSecurity A_1)
at EO.Pdf.PdfDocument..ctor(String fileName)
at ...(I've omitted our code's portion of the call stack)
Exception with v17.2.43.0
at EO.Internal.pl.d()
at EO.Internal.aai.a(gb A_0)
at EO.Internal.gb.a(akq A_0)
at EO.Internal.gb.a(Stream A_0, Boolean A_1, Boolean A_2)
at EO.Internal.gb.a(String A_0)
at EO.Internal.gb..ctor(String A_0, PdfDocumentSecurity A_1)
at EO.Pdf.PdfDocument..ctor(String fileName)
at ...(I've omitted our code's portion of the call stack)