Ask Your Question
0

--convert-to txt:Text does nothing

asked 2017-04-26 20:19:47 +0100

bert_jp gravatar image

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!

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2017-04-26 22:08:52 +0100

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.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-04-26 20:19:47 +0100

Seen: 406 times

Last updated: Apr 26 '17