How to do visual debugging of a PDF #1260
-
I saw in a post a few days ago (sorry, I lost it), a PDF that had all of the elements outlined in different colors so you could see the edges of each piece of text. Is there a trick for doing that? I don't think I've seen it in the docs, but it would help with a project I'm doing related to the intersection of rectangles with words. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 3 replies
-
did you mean this: https://github.com/pymupdf/PyMuPDF-Utilities/blob/master/text-extraction/layout-demo1.pdf |
Beta Was this translation helpful? Give feedback.
-
In the end, the issue I had was that I was doing:
And then:
That totally doesn't work for multi-line redactions like I had. In those cases, you have to read the docs, which explain that the |
Beta Was this translation helpful? Give feedback.
-
I could not agree more 😎👍😉 |
Beta Was this translation helpful? Give feedback.
In the end, the issue I had was that I was doing:
And then:
That totally doesn't work for multi-line redactions like I had. In those cases, you have to read the docs, which explain that the
drawing["items"]
key is where the real shapes are. Once I started using those, I was able to handle the multi-line redactions no problem.