Skip to content

Bug: scripts/pdf2doc.py fails — wrong pdf2docx class and method names #17

Description

@utk2103

scripts/pdf2doc.py cannot run. Three separate mistakes against the pdf2docx API:

from pdf2docx import Convertor   # ImportError — the class is `Converter`
cv = Convertor(pdf_file)
cv.convertor(docx_file)          # AttributeError — the method is `convert`
cv.close                         # references the method, never calls it

It also hardcodes ListsOfInbuiltMethods.pdf, which lives in resources/, so even with the names fixed the path fails from the repo root.

Expected

python scripts/pdf2doc.py resources/ListsOfInbuiltMethods.pdf output.docx

Acceptance criteria

  • Converter, .convert(docx_file), .close() — correct names, close() actually called.
  • Input and output paths come from argparse, not hardcoded.
  • Missing input file → clear message, not a traceback.
  • Verified by converting a PDF from resources/ end to end.
  • Keep the "needs pip install pdf2docx" note at the top of the file.

Good first issue — the fix is small, but you'll need to install pdf2docx and actually run it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions