How to convert pdf to doc using python and libre office?

conversion using python

There is no method to convert PDF to .doc in LO.

Is there any other way to do?

Possibly other tools on internet.

(Python not addressed here!)

Probably OCR with export to (MSO .doc?). LibO .odt? Or a full-grown pdf software which LibO surely isn’t.

A pdf not containing an embedded document (“hybrid pdf”) will be opened in ‘Draw’ by LibO, and this may give access to texdtual content - or only to images.

If you only want to get unformatted text content for further manipulation/editing, the “samrt” ways of many OCR to receate formatting may not be welcome. You can try then the solution from the attachment to my answer here (inserted by editing there). Please note that there a sort coded in Basic is involved which not is optimised for efficiency.

As a Python user you surely know how to use the better standard functions available there for the respective tasks. Code using the API will need a different rewrite.