PDF Page Counter - Code. Project. Introduction. My company Red Cell Innovation Inc. Often we require a page count of a collection of PDF files for the purpose of billing, quality control, scheduling, and estimating. This is an application that I quickly whipped up to facilitate this. The application uses a procedural style to accomplish this in about 2. XAML and comments in a single simple codebehind class. Features. Simple: Drop a directory in the application. Fast: Scanned 2. 0GB of PDFs and counted 5. SSD (2. 70 seconds on a network drive). How It Works. Language. C# 5. 0. NET Framework. UI Framework. WPFLibrariesi. Text. Sharp. Pattern. Codebehind procedural. When the application starts, the user is prompted to drop files and/or folders into the application's window.
When files or folders are dropped, the Start method is invoked, changing the visibility of UI elements to the count screen. The async Analyze method is invoked to create a new thread that traverses the filesystem recursively. A new thread is requested from the thread pool for each directory to be enumerated and its files counted. Task Analyze (IEnumerable< string> filenames). Since PDF files are internally indexed, the document does not need to be scanned (see PDF Syntax). Instead a Pdf. Reader object is instantiated and its Number Of. Pages property read. The system resources used are negligible. PDF Syntax. This could have been done quite easily without i. Text. Sharp by creating a simple PDF parser; however this would have increased the time required to develop the application, which was about an hour, already being familiar with i. Text. Sharp. To accomplish this without i. How to count pages for.doc and.pdf? Get Number of Pages in a PDF File; Add. VB.NET ' instantiate. Get PDF file page count using VB.Net code. I have lot of PDF files in one folder. Text. Sharp we would read the PDF and follow the references. This is a syntactically correct and complete PDF file. We can see that section 1 contains the Catalog, which points to reference 3 as the Pages section. Note how the Pages resource describes a single page, described in section 4.%PDF- 1. Type /Catalog. /Outlines 2 0 R. Pages 3 0 R. < < /Type Outlines.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2017
Categories |