Skip to content
Discussion options

You must be logged in to vote

Is there any other way to replicate the same?

There is if you can get a hold of the original fonts. This can be cumbersome, because in the general case you must

  1. set a global parameter that causes the full font names be contained in the "dict" - i.e. including the "ABCDEF+"-prefixes for the subsetted fonts if any: fitz.TOOLS.set_subset_fontnames(True),
  2. find the xref of that font in page.get_fonts(),
  3. extract the font via doc.extract_font(xref),
  4. insert the font in the new page via page.insert_font(fontname="unique-string", fontbuffer=buffer) with the buffer returned by font extraction.
  5. Insert text using page.insert_text(point,text,fontname="unique-string"). So the fontname must be differe…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
2 replies
@JorjMcKie
Comment options

@syntax-surgeon
Comment options

Comment options

You must be logged in to vote
1 reply
@syntax-surgeon
Comment options

Answer selected by syntax-surgeon
Comment options

You must be logged in to vote
3 replies
@JorjMcKie
Comment options

@syntax-surgeon
Comment options

@JorjMcKie
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants