Opening a corrupted PDF (eg. a file with a size of 0) using Load(string path) or Load(string path, string password) locks the file till closing the application because the filestream is not disposed. Load(IWin32Window owner, string path) does not shows this behavior.
I have solved this problem as follows:
public class PdfDocument : IPdfDocument
{
[...]
// new static function
private static FileStream OpenRead(string path)
{
FileStream fs = null;
using (fs = File.OpenRead(path))
{
}
return fs;
}
[...]
instead in using File.OpenRead(path) I use the new static function OpenRead.
Opening a corrupted PDF (eg. a file with a size of 0) using Load(string path) or Load(string path, string password) locks the file till closing the application because the filestream is not disposed. Load(IWin32Window owner, string path) does not shows this behavior.
I have solved this problem as follows:
instead in using File.OpenRead(path) I use the new static function OpenRead.