Comments (1)
That's in effect impossible as you need to run a file utility request (they must open the file to read the contents)
PDF page entries are stored in a semi-random set of numbered entries so it is possible for 2 entries from different times to only produce 1 page and also in rare cases a single page spawn another. However you will not know until the file is decrypted (if locked) or when scripts are running.
There are many command line tools like PDFinfo to report a calculated guess based on the raw count of KIDS entries, but they may not be true in 100% of all cases, all such tools will need to process a file from first to last byte. So usually its a slow task, unless they stored a set of counts from previous runs, like a database.
Here one single PDF has other PDFs nested inside it so the GhostScript count is unverified as to the total number of pages combined.
Either you run windows FindStr to look for the page count texts (if not encrypted) or a command line tool like GhostScript to show calculated number of pages that it finds by silent running through all the entries.
HOWEVER just like DocX there are files where the number of pages will change when the contents are running live in screen. This is common with Forms that self adjust especially scripted XFA ones which SumatraPDF does not run.
Above GS-estimate is based on script
@echo off
color cF & MODE CON: COLS=40 LINES=12 & title "%~n1.pdf" number of pages
cd /d "%~dp1"
"%~dp0\gswin32c.exe" -q -dBATCH -dPDFINFO "%~n1.pdf" 2>%temp%\output.txt
findstr "has" %temp%\output.txt
pause
del %temp%\output.txt
from sumatrapdf.
Related Issues (20)
- Local manual and keyboard shortcuts don't open HOT 6
- Option to make home tab smaller and unclosable
- provide x86-64-v3 (AVX2) version
- Collapse arrow in Bookmarks is not easily visible in Dark theme HOT 2
- when view chm the file, the app crashed if you click favorites in menu. HOT 1
- Many errors building last version HOT 2
- Foxit PDF Reader 12 not detected by Sumatra PDF. HOT 1
- Builded, when #undef ENABLE_CRASH_REPORTING HOT 1
- Ability to display more than 2 columns of pages at a time HOT 1
- thumbnails disappearing from sumatrapdfcache HOT 7
- Bug report HOT 2
- Installer should remember settings HOT 2
- Search: Match whole word Button HOT 7
- Epub line overlap bug HOT 2
- Advanced Settings file changes Recently require quit and reload HOT 4
- Horrible toolbar icons HOT 1
- Opened pages lost on update HOT 1
- Please make a linux version and destroy the competition HOT 1
- Unable to display emoji expressions. HOT 3
- Use a standard file format for SumatraPDF-settings.txt HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sumatrapdf.