'add_redact_annot' asking for 'need font file or buffer' for an existing font in PDF #3224
Unanswered
santanuOUP
asked this question in
Q&A
Replies: 3 comments
-
This doesn't work like that!
|
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @JorjMcKie , Thanks for your reply. As you said I have implemented following:
My desired font is : 'CIDFont+F2' which is not a Base14 font, I think. But it is an existing font within the PDF and used by other texts also, so why it needs to be included again ? |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Description of the bug
Trying to replace one text in a PDF using the following methods:
add_redact_annot
apply_redactions
Text replacement is done but the replaced text is not showing just like the searched text. So, wanted to apply the same font but PyMuPDF is throwing exception saying "need font file or buffer". Font for searched text was 'Verdana' so want to apply the same font for the replaced text.
Here is the log for the operation:
2024-02-29 11:42:34,188 Filename to process: Sample
2024-02-29 11:42:34,194 fonts: [(7, 'ttf', 'TrueType', 'FAAAAH+TimesNewRomanPSMT', 'FAAAAH', 'WinAnsiEncoding'), (11, 'ttf', 'TrueType', 'FAAABB+Verdana', 'FAAABB', 'WinAnsiEncoding'), (16, 'ttf', 'TrueType', 'FAAABG+Verdana-Bold', 'FAAABG', 'WinAnsiEncoding')]
2024-02-29 11:42:34,204 hits: [Rect(170.0, 252.3948974609375, 222.64393615722656, 265.7635498046875)]
2024-02-29 11:42:34,209 search_text: LocalPath
2024-02-29 11:42:34,209 search_text_size: 11.0 search_text_font: Verdana
2024-02-29 11:42:34,213 Exception raised: need font file or buffer
Here is my code:
Trying for long time, need help!
How to reproduce the bug
PyMuPDF version
1.23.25
Operating system
Windows
Python version
3.8
Beta Was this translation helpful? Give feedback.
All reactions