79818985

Date: 2025-11-13 14:28:25
Score: 1
Natty:
Report link

The answer, based on comments by @colonel and @vladimir:

def pdf_to_word(pdf_path, docx_path):
    """Uses pdf2docx Converted to turn a pdf into word, because word is way easier to decode into an xml."""
    
    cv = Converter(pdf_path)
    cv.convert(docx_path, multi_processing=True, cpu_count=6)
    cv.close()


if __name__ == '__main__':
    pdf_to_word("example.pdf", "example.docx")

note: I have cpu_count=6 here, but you can check how many cpu's you have by doing

>wmic cpu get numberofcores

in the command line.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • User mentioned (1): @colonel
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: user30589464