linuxserver / docker-libreoffice

GNU General Public License v3.0
76 stars 14 forks source link

Error: Source file could not be loaded [BUG] <title> #12

Closed NTC4818 closed 3 months ago

NTC4818 commented 3 months ago

Is there an existing issue for this?

Current Behavior

When trying to convert document to pdf continues to fail to load.

Expected Behavior

Should convert pdf back to same directory

Steps To Reproduce

FROM lscr.io/linuxserver/libreoffice:latest

import subprocess output_dir = "./" word_file_path = "/workspaces/DSEP_2008/18764268.docx" conv_cmd = f"soffice --headless --norestore --invisible --nodefault --nofirststartwizard --nolockcheck --nologo --convert-to pdf:writer_pdf_Export --outdir {output_dir} {word_file_path}" response = subprocess.run(conv_cmd.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE) print(response) print("Testing")

python 3.11

Environment

- OS:
- How docker service was installed:

CPU architecture

x86-64

Docker creation

Docker pull from location and docker run in vscode.

Container logs

e494e2c2667a:/workspaces/DSEP_2008# ls
13102855.doc  18330618.msg  18764268.docx  18764275.docx  CombinedData.xlsx  testing.py
e494e2c2667a:/workspaces/DSEP_2008# python testing.py
CompletedProcess(args=['soffice', '--headless', '--norestore', '--invisible', '--nodefault', '--nofirststartwizard', '--nolockcheck', '--nologo', '--convert-to', 'pdf:writer_pdf_Export', '--outdir', './', '/workspaces/DSEP_2008/18764268.docx'], returncode=0, stdout=b'', stderr=b'Error: source file could not be loaded\n')
Testing
github-actions[bot] commented 3 months ago

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

homerr commented 3 months ago

I've just spun this container up, flung a .docx into it and then saved it as a .pdf with no issue.

I'd recommend you recreate this container as per the guidelines here: https://github.com/linuxserver/docker-libreoffice?tab=readme-ov-file#usage

And try again.