For a lot of PDF pages I get a SharpZipBaseException when calling XGraphics.FromPdfPage.
The exception is thrown in InflaterInputStream.Fill() with message "Unexpected EOF".
I can 'fix' this problem using a hack in InflaterInputStream.Read:
public override int Read(byte[] buffer, int offset, int count)
....
if (inf.IsNeedingInput)
{
try
{
Fill();
}
catch(SharpZipBaseException)
{ // WB! early EOF: apparantly not a big deal for some PDF pages: break out of the loop.
break;
}
}
...
For a lot of PDF pages I get a SharpZipBaseException when calling XGraphics.FromPdfPage. The exception is thrown in InflaterInputStream.Fill() with message "Unexpected EOF".
I can 'fix' this problem using a hack in InflaterInputStream.Read: