AlJohri / docx2pdf

MIT License
497 stars 94 forks source link

not converting a docx file into pdf without creating a docx file #61

Closed abeepathak96 closed 2 years ago

abeepathak96 commented 2 years ago

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

AlJohri commented 2 years ago

@abeepathak96 this is currently unsupported

write your document to /tmp path and then pass it to the convert method