Is it possible to get the xref for a block? #1160
-
1 My real intention is to delete a piece of text. I get the text by 2 I noticed there is a code https://github.com/pymupdf/PyMuPDF-Utilities/tree/master/font-replacement 3 Follow the code above, it checked the font name to location in the stream, Can I locate the word in the stream directly? How? I found someone user code like this so how can i do if i just want to delete a few word in the pdf thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Arranging text to blocks is happening inside MuPDF - it is done with some heuristics based on coordinates, fontsizes and so on. To delete text, you can either follow the pattern of font replacement as you already observed. Forget your option 3: this requires a lot of translation work (unicode -> glyph -> position info ...) already implemented by MuPDF logic in redactions. |
Beta Was this translation helpful? Give feedback.
Arranging text to blocks is happening inside MuPDF - it is done with some heuristics based on coordinates, fontsizes and so on.
There is nothing "physical" in the document representing a block.
To delete text, you can either follow the pattern of font replacement as you already observed.
Or use redaction annotations. Then MuPDF code will physically remove text for which you have provided a rectangle. You then have a number of options to fill that gap with new stuff: text, images, ...
Forget your option 3: this requires a lot of translation work (unicode -> glyph -> position info ...) already implemented by MuPDF logic in redactions.