-
Notifications
You must be signed in to change notification settings - Fork 544
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
get_toc(simple=False) return 'to' point coordinate is not based on top-left origin #3412
Comments
You did not provide the reproducing file. |
sorry, i could not upload mypdf file for some reason. However, it is pretty clear that 'to' point in toc is based on i simply want to convert 'to' points to |
It is not all clear: Again: without the file in question we are already wasting time. |
Maybe you simply had a question and just wanted to know how to do coordinate transformation? |
Sorry for the "**" signs, i just want to get bolded fonts, and i already delete them. my question is:
|
Ok - to make some progress, I transferring this thread to Discussions, and we can continue there. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Description of the bug
i have a pdf, with outlines(titles) and content below:
and i want to extract all the outline(titles) and their coordinates in page.
when i use
get_toc(simple=False)
, fitz return a toc list:the returned 'to' points is not based on top-left origin, but bottom-left origin, because
1.1 Hello world
is above1.1.1 first step to hello world'
, but Point(0.0, 761.8583) is greater than Point(0.0, 731.8583),it seems like pdf coordinates, not (py)mupdf coordinates.
how to covert those toc 'to' points to top-bottom coordinates.
How to reproduce the bug
import fitz
document = fitz.open('mypdf.pdf')
toc = document.get_toc(simple=False)
toc results:
PyMuPDF version
1.24.1
Operating system
Linux
Python version
3.9
The text was updated successfully, but these errors were encountered: