Reputation: 590
I developed a software on my windows machine with fpdf2
for python.
It worked perfectly, but now I have to install this program on a Red Hat Linux server and when I try to add custom font to pdf it throws an error: cannot instantiate 'WindowsPath' on your system
the code:
pdf = FPDF()
FONT_REGULAR = os.path.join(os.path.dirname(__file__), "fonts", "arial.ttf")
pdf.add_font("Regular", "", FONT_REGULAR, uni=True)
At this line it throws an error:
<NotImplementedError> "cannot instantiate 'WindowsPath' on your system"
Is there a workaround to this?
fpdf2 version: 2.4.5
Upvotes: 0
Views: 598