When I call convert_to_pdf
it causes the resulting pdf font to be ghosted.
#3356
-
When I call
May I ask, is there a problem, or do I need to convert the time to set what parameters to achieve, it seems that pymupdf in the conversion of the time occurs ocr |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
As documented under method In [1]: import fitz
In [2]: doc = fitz.open("test.pdf")
In [3]: pdfdata = doc.convert_to_pdf()
cannot create ToUnicode mapping for NQAVHI+AdobeSongStd-Light
cannot create ToUnicode mapping for KJRDRO+FangSong_GB2312
cannot create ToUnicode mapping for LNBJFM+Symbol_ASME
cannot create ToUnicode mapping for PPUUMW+SimHei
In [4]: new = fitz.open("pdf", pdfdata)
In [5]: new.ez_save("converted.pdf") Messages are from the MuPDF converter. What are you trying to achieve anyway? |
Beta Was this translation helpful? Give feedback.
-
@JorjMcKie |
Beta Was this translation helpful? Give feedback.
Just as I suspected! I have good news for you:
The base library has a solution for this, which is immediately available in PyMuPDF. There is a function that "bakes" annotations and fields (!!!) into the PDF - which means it converts these items into normal page content.
You have to bake the source PDF before using it in
.show_pdf_page()
. After baking, no annotations and no fields will exist anymore - but otherwise, every page will look exactly equal.This is how it works: