modify version of http://www.codeproject.com/KB/files/xpdf_csharp.aspx