Hi, there is a bug in MuPDFPageCollection.GetEnumerator implemention.
public IEnumerator<MuPDFPage> GetEnumerator()
{
for (int i = 0; i < Pages.Length; i++)
{
if (Pages[i] == null)
{
Pages[i] = new MuPDFPage(OwnerContext, OwnerDocument, i);
}
}
return (IEnumerator<MuPDFPage>)Pages.GetEnumerator();
}
The type of Pages.GetEnumerator() is SZArrayEnumerator, it can not be cast to System.Collections.Generic.IEnumerator.
Thank you for spotting this! I have included your fix in version 1.2.4 (the NuGet package should become available as soon as it finishes validation and indexing).
Hi, there is a bug in MuPDFPageCollection.GetEnumerator implemention.
The type of
Pages.GetEnumerator()
isSZArrayEnumerator
, it can not be cast toSystem.Collections.Generic.IEnumerator
.