Skip to content

not able to convert the document object to pdf without creating a docx file #1054

@abeepathak96

Description

@abeepathak96

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions