Same fontname and encoding but different symbolic name #3738
Unanswered
meghanaviyyapu
asked this question in
Looking for help
Replies: 2 comments
-
There is no way to systematically find this out. import pymupdf
doc = pymupdf.open("3.pdf")
page = doc[0]
pnt = (100, 100)
fontbuffer = doc.extract_font(555)[-1]
page.insert_font(fontname="f0", fontbuffer=fontbuffer)
text = "CR200078"
page.insert_text(pnt, text, color=(1, 0, 0), fontname="f0")
doc.ez_save("x.pdf")
`` |
Beta Was this translation helpful? Give feedback.
0 replies
-
Thanks for the explanation |
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
-
In the PDF tagged1.pdf, when I execute page.get_fonts() there are multiple font properties with the same name "FrutigerboldNormal" and MacRomanEncoding but the symbolic names of fonts are different. In this case, how to identify which symbolic name works and which doesn't while inserting text using page.insert_text()?
Attached the output of page.get_fonts(),
1.pdf in which the text "CR200078" was inserted using symbolic name T1_0 and it worked fine
3.pdf in which the text was inserted using T1_1 symbolic name. There was no text but some weird character
Could you let me know why some symbolic names from page.get_fonts() are able to insert text well and why some are not? How to identify the correct one?
1.pdf
tagged1.pdf
3.pdf
Beta Was this translation helpful? Give feedback.
All reactions