Recreating texts in a new pdf with the same font and size #1599
-
Hi, I have the following code snippet to do this:
the list of returned fonts are as follows:
The question is:
Here is the pdf file used as reference: thanks for the help as always |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 5 replies
-
The "n/a" fonts refer to fonts which are expected to be supported by all PDF viewers natively, i.e they all must have this support built in. This usually applies to the Base-14 and some CJK fonts.
|
Beta Was this translation helpful? Give feedback.
-
Okay, thanks for the clarification for n/a so it means that the file is 'non-embedded'. if this is the case, How can I use the information from the output of page.get_font():
and write a text in a new page with the same font? |
Beta Was this translation helpful? Give feedback.
-
so there is no direct way to do this? where I can just reference the output of the if that was the case, I was just thinking that, the best way I could do this is just create a default dictionary for all not embedded fonts where: |
Beta Was this translation helpful? Give feedback.
-
BTW any specific reason why you use JSON as the text extraction format? |
Beta Was this translation helpful? Give feedback.
-
The requirement for PDF viewers to reproduce the appearance of Base-14 fonts in exactly the same way is in reality an illusion. There are differences. |
Beta Was this translation helpful? Give feedback.
-
I think all your motivation/intent is covered here: #1527. |
Beta Was this translation helpful? Give feedback.
I think all your motivation/intent is covered here: #1527.