pymupdf / PyMuPDF

PyMuPDF is a high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents.
https://pymupdf.readthedocs.io
GNU Affero General Public License v3.0
4.52k stars 446 forks source link

page.get_label() gets wrong label on the first page of doc #3510

Closed binshe closed 1 week ago

binshe commented 1 month ago

Description of the bug

>>> import pymupdf

>>> pymupdf.version
('1.24.4', '1.24.2', '20240516000001')
>>> doc = pymupdf.open("test3.pdf")

>>> doc._get_page_labels()
[(0, '<</S/A>>'), (13, '<</S/r>>'), (15, '<</S/D>>')]
>>> doc[0].get_label()
'B'

First page label supposed to be 'A' ...

Please take a look.

How to reproduce the bug

As in description

PyMuPDF version

1.24.4

Operating system

MacOS

Python version

3.9

julian-smith-artifex-com commented 1 week ago

Fixed in 1.24.6.