How to stop LibreOffice from outputting a converted file into a folder via command line?

Hello All-

Quick question. I’ve been using LibreOffice to convert single Microsoft Office files into PDFs. It works great, but it outputs the PDF into a folder with the same name as the file.

For example:
C:\Desktop\TextDoc.PDF\TextDoc.PDF

Notice that the actual file is nested inside of a folder which shares the exact same name. Is there anyway to prevent LibreOffice from doing this? I just want it to output the converted file to the directory I specify, without nesting it inside of a new folder.

Any help would be greatly appreciated.

Thanks.

– EDIT –
Just realized I’m a fool. LibreOffice does exactly what it’s supposed to. I was including the filename in my -outdir parameter and that’s why it was creating the folder. There was no problem other than user error. My apologies.

@chiefwarpaint, No worries – other users might have the same problem and come to the Ask site and find this Answer :slight_smile:

Use the --outdir command-line parameter:

qubit@pt$ soffice --headless --convert-to pdf woo2-dinosaur.odt --outdir /other/directory/

can you convert the file so the file will have a different name?