Convert .pdf to .odf with the command line doesn't work

I am trying to convert a PDF file using LibreOffice in headless mode from the command line.

This is the command I am using:
soffice --headless --convert-to odf "E:\Personal\AJTP\BOE DE PRUEBA\CONVERSION.pdf" --outdir "E:\Personal\AJTP\Archivos"


The path to soffice works correctly and the command is executed, but the --convert-to option does not seem to work as expected. The file is not converted, and no output file is generated in the destination directory.

I have verified that:

  • The input file path is correct
  • The output directory exists
  • LibreOffice runs without errors in --help

However, the conversion itself fails.

What could be causing --convert-to to not work in this case?
Is there an issue with converting PDF files to ODF using LibreOffice, or am I missing an additional parameter or configuration?

Which file format is “odf” in convert-to odf? Do you intend to convert to Math document (formula)?

(And absence of output in the console would likely mean that you have LibreOffice already running.)

1 Like

Sorry, I have dyslexia and I confused .odt with .odf
Now it works