Page number extracting issue #2159
Answered
by
JorjMcKie
Arif11112000
asked this question in
Looking for help
-
Beta Was this translation helpful? Give feedback.
Answered by
JorjMcKie
Jan 5, 2023
Replies: 1 comment 1 reply
-
Everything ok: import fitz
doc=fitz.open("pymupdf.pdf")
page=doc[4]
page.get_label()
'iii' |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
JorjMcKie
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Everything ok:
page=doc[11]
is page number 12 in 0-based counting scheme.But a PDF also supports page labels, which can be literally anything the PDF creator likes to see, e.g. "A-1" or Roman numbers.
So your situation may also be blurred by this.
PyMuPDF also supports page labels, and you get see what your page's label is by
page.get_label()
: