TypeError: init() missing 1 required positional argument: 'parser'
改doc = PDFDocument()为doc = PDFDocument(parser),需要将parser作为参数传递给函数。
如有帮助请点采纳。