WSL2 Ubuntu 24.04
LibreOffice 24.2.7.2 ee3885777aa7032db5a9b65deec9457448a91162
There are some Word files, if I open them with LibreOffice GUI, click “Export Directly as PDF”, and specify output directory, the conversion works just fine.
If I try to do the exactly thing with cmd, aka.
import subprocess
cmd = [
'soffice',
'--headless',
'--convert-to',
'pdf',
'--outdir', str(file.parent),
str(file)
]
process = subprocess.run(cmd)
This will suck at the conversion, where ~.lock file and .tmp file both visible but latter not accessible (Permission denied).
FYI, I installed LibreOffice through cmd and manually installed GUI myself. I added GUI just to test if the file itself is corrupt/broken and ideally I don’t want to use GUI by all means. I guess reinstalling LibreOffice with GUI in the first place is the best approach but since I need to make sure this conversion works for my non-graphical servers, I am more inclined to solve it through code/cmd.
Any idea why is this happening? Any help will be appreciated.