Reputation: 372
While checking out wxPython's wx.lib.pdfViewer
, I ran the code in the documentation. It worked well, but most of the pdf did not load, and messages like these
Unknown font ghlcbg+arial
Unknown font ghlcdi+arial,bold
were printed. I surmise that it is because the fonts used in the pdf are not implemented by PyPDF2. How can I solve this problem? I can preprocess the pdf to replace the fonts if necessary, but this I do not know how to do either.
Is there a library which allows for replacement of fonts? If there is not, is there a replacement for PyPDF2 which permits this replacement (PyMuPDF does not work for me due to another error)? If such a replacement is not possible, is there an extension which permits the interpretation of such fonts?
Upvotes: 0
Views: 210
Reputation: 33071
wxPython cannot load a PDF that PyPDF2 does not support. I think there is talk about moving to pdfrw, but that has not occurred as of yet and I don't know if it actually has handling for unknown fonts or not. The main benefit to moving is PyPDF2 is no longer being maintained.
PyQt can do it since it integrates with poppler. See https://github.com/frescobaldi/python-poppler-qt4 or http://shallowsky.com/blog/programming/qt5-poppler-pdf.html
Upvotes: 1