--convert-to txt:Text does nothing

I need to be able to convert various documents to txt.

I’ve tested many different input formats and none of them work. I’m not sure what the problem is as libreoffice convert does not give any error messages. I think I might be missing some sort of “filter”, but I don’t know where to find that or how to install it.

I can convert to PDF just fine, so libreoffice itself is working. What do I need to do to be able to convert-to txt:Text?

This is an example command:
soffice --headless --convert-to txt:Text --outdir files “files/test.pdf” 2>&1

Thanks!

In your example command, you import pdf. This is done into Draw by default, and then there’s no “txt:Text” output filter for Draw document. To import into Writer (which has that output filter), you could use this command:

soffice --infilter=writer_pdf_import --convert-to txt --outdir files files/test.pdf

… and this will generate the output txt file, but - it will be empty. That’s because text in PDFs is imported into text frames, which aren’t exported into txt.

You could try to take @Lupp’s script from here and call it after import.