Loading of the encrypted file fails unpredictably

Hello,

We have faced an issue while running the same code on the newer version of the Gembox PDF.

It did work with version 17.0.1648. But seems to be broken: 2025.4.103

Here is the code:

using var source = PdfDocument.Load(sourceFilePath, new PdfLoadOptions { ReadOnly = true });
 foreach (var page in source.Pages)
{
    var pageText = page.Content.GetText(new PdfTextOptions
    {
        Order = PdfTextOrder.Reading,
        Whitespaces = PdfTextWhitespaces.Space | PdfTextWhitespaces.NewLine
    })?.ToString();
}

Here are the exception details:

Message: 
    GemBox.Pdf.InvalidPdfDictionaryEntryException : Dictionary entry is missing.
 
  Stack Trace: 
    PdfDictionary.(e )
    e.(PdfDictionary , e )
    e.[T](PdfDictionary , e )
    .()
    .()
    .eradqm6w7emnv47fgcqwxpktdtfcma8ne()
    .(PdfBasicFont )
    .ctor( )
    .ctor( ,  )
    .( , Boolean )
<10 more frames...>
    .( ,  ,  ,  ,  )
    .( ,  ,  , Nullable`1 , Nullable`1 )
    .( , PdfContentElementCollection ,  ,  )
    PdfContent.ctor( ,  )
    PdfPage.get_Content()
    PdfExtractor.GetPdfDocumentContent(PdfDocument pdfDocumnet, CancellationToken cancellationToken) line 141
    PdfExtractor.ExtractPdfContent(String sourceFilePath, CancellationToken cancellationToken) line 71
    PdfExtractionTests.Pdf_content_extraction_with_limited_permission_file_returns_correct_text_and_page_count() line 46
    RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor)
    MethodBaseInvoker.InvokeWithNoArgs(Object obj, BindingFlags invokeAttr)

I will forward the input file via email!

Thanks much!

This issue is now resolved in the latest version:

Regards,
Mario