How to Batch OCR PDF Files and Count Pages
Question details
The user needs a method to apply Optical Character Recognition (OCR) to a large batch of PDF/A files and calculate the total number of pages across all files located in a specific folder.

- Product
- PDF Tools
- Device & OS
- not provided
- Scenario
- Processing a folder containing approximately 100 PDF files to make them text-searchable and obtaining an aggregated total page count.
- Observed behavior
- The user wants to automate the OCR process for multiple files simultaneously and get a total page count without manually opening and checking each individual PDF file.
Gather all your target PDF files into a single folder to streamline the batch processing. Ensure that none of the PDF files are password-protected or restricted against editing, as encryption will block the OCR process.
Use Adobe Acrobat Pro Action Wizard and Portfolio
Utilize Adobe Acrobat Pro's built-in automation features to batch process OCR and view combined page counts.
Acrobat Pro offers an Action Wizard that automates repetitive tasks across multiple files. You can also use the PDF Portfolio feature to aggregate metadata, including page counts, for multiple documents.
Open Adobe Acrobat Pro, go to 'Tools', and select 'Action Wizard'. Click 'New Action', add the 'Recognize Text' tool to the action steps, specify your target folder containing the PDFs, and save the action.
Select your newly created OCR action from the Action Wizard list, click 'Start', and allow Acrobat to process and save all the PDFs in your selected folder.
To count the pages, go to 'File' > 'Create' > 'PDF Portfolio'. Add the folder containing your PDFs. Switch to the 'List' view in the portfolio, right-click the column headers to ensure 'Pages' is checked, and tally the total.

Use Dedicated Document Management Utilities
If you frequently process large folders of PDFs, specialized third-party tools or scripts can efficiently OCR and count pages in bulk.
Extract Text and Manage PDFs with WPS Office
WPS Office includes a powerful PDF editor that supports advanced OCR technology. You can easily extract text from scanned documents, convert PDFs to editable formats, and merge multiple PDFs to quickly determine total page counts.
- 1. Open WPS PDF: Launch WPS Office and open your target PDF file using the built-in WPS PDF tool.
- 2. Apply OCR: Navigate to the 'Tools' tab and select 'OCR'. Choose to extract the text directly or convert the scanned document into an editable Word or Excel file.
- 3. Merge to Count Pages: To count pages across multiple files, use the 'Merge PDF' tool to combine your folder's PDFs into one single document. The total page count will be instantly displayed at the bottom of the screen.

Frequently Asked Questions
Does OCR alter the original formatting of my PDF?
When applying OCR, you can usually choose between making the text searchable (which keeps the original scanned image intact and adds a hidden text layer) or converting it to editable text (which may alter formatting depending on the complexity of the document).
Why did the OCR process fail on some of my PDF files?
OCR can fail if the PDF is password-protected, has restrictive editing permissions, or if the source document's image quality is too blurry, skewed, or low-resolution for text recognition.
Can I run OCR on PDF/A files?
Yes, you can run OCR on PDF/A files. However, saving the changes might require the software to temporarily remove the PDF/A compliance or re-validate and save it back as PDF/A after the searchable text layer is added.
Is there a way to count pages in a folder without opening the PDFs?
Yes, you can use specialized document management software, command-line scripts (like ExifTool or Python's PyPDF2), or create a PDF Portfolio in Acrobat to view the metadata, including page counts, without manually opening each file.




