public static int GetPDFPageCount(string path) { PDDocument doc = PDDocument.load(path); return(doc.getPageCount()); }