Exception and Error Handling

PDFNet uses exceptions to report exceptional program states and corrupt input. For example:

try 
{
  PDFDoc doc = new PDFDoc("file.pdf");
  doc.InitSecurityHandler();
  doc.GetPage(9999999); 
  // ...
}
catch (PDFNetException e) 
{
  Console.WriteLine(e.Message);
}