Use LibreOffice through python to edit pdf

I want to edit PDF files through LibreOffice and that too using python.

Scenario: I have PDF files in a folder. These PDF files have textual content as well as images. I want to remove all the textual content leaving behind images only. Is there a way in which I can write a python code which will control LibreOffice to access PDF files in that particular folder and remove all the textual part?

Thanks in advance.