Replies: 7 comments 8 replies
-
You did not provide the reproducing file. |
Beta Was this translation helpful? Give feedback.
-
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 |
Beta Was this translation helpful? Give feedback.
-
It is not all clear: Again: without the file in question we are already wasting time. |
Beta Was this translation helpful? Give feedback.
-
Maybe you simply had a question and just wanted to know how to do coordinate transformation? |
Beta Was this translation helpful? Give feedback.
-
Sorry for the "**" signs, i just want to get bolded fonts, and i already delete them. my question is:
|
Beta Was this translation helpful? Give feedback.
-
Ok - to make some progress, I transferring this thread to Discussions, and we can continue there. |
Beta Was this translation helpful? Give feedback.
-
The two TOC entries obviously point to named destinations. You can extract (but not set / update) a PDF's defined symbolic names as a Python dictionary via |
Beta Was this translation helpful? Give feedback.
-
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
Beta Was this translation helpful? Give feedback.
All reactions