Hi, I am working on a project where I need to read a docx file, edit the file and then convert it into a pdf. for reading and editing the docx file I am using python-docx package, but when using the edited document to convert to pdf I am facing issues.
import docx from docx2pdf import convert document = docx.Document('data/PO.docx') """ Editing the document """ convert(document, 'output.pdf')
I am facing following error.
TypeError: expected str, bytes or os.PathLike object, not Document
Hi, I am working on a project where I need to read a docx file, edit the file and then convert it into a pdf. for reading and editing the docx file I am using python-docx package, but when using the edited document to convert to pdf I am facing issues.
import docx from docx2pdf import convert document = docx.Document('data/PO.docx') """ Editing the document """ convert(document, 'output.pdf')
I am facing following error.
TypeError: expected str, bytes or os.PathLike object, not Document