Possible Duplicate:
Determine Number of Pages in a PDF File using C# (.NET 2.0)
I used the following code to get the count of number of pdf files in a directory.
    var extensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase) 
    {
        ".pdf", 
    };
    var baseDir = BatchFolderPath;
    var pdfFilesCount = Directory.EnumerateFiles(baseDir)
                                 .Count(filename =>
                                        extensions.Contains(Path.GetExtension(filename)));
I don't know how to get the number of pages inside each pdf document inside a directory. Please help. Thanks.