How to Solve NameError: name 'pdfmetrics' is not defined -- reportlab

Solution: Import the 'pdfmetrics' module

To Solve the error, add the following line to the top of your code.

from reportlab.pdfbase import pdfmetrics

 

For more information:
Python reportlab pdfmetrics