unoconv / unoserver

MIT License
496 stars 69 forks source link

Runtime error with unoconvert: "Could not find an export filter ... to generic_Text" #42

Closed TaProhm closed 1 year ago

TaProhm commented 1 year ago

Hello and thank you for all unoconv projects.

I am trying to run unoserver in docker and getting some issues with unoconvert.

The Dockerfile content is the following:

FROM eclipse-temurin:8u332-b09-jre-jammy

WORKDIR /var/unoserver

RUN apt-get update \
    && apt-get install -y \
        wget \
        libreoffice \
        libreoffice-writer \
        ure \
        libreoffice-java-common \
        libreoffice-core \
        libreoffice-common \
    && apt-get remove -y libreoffice-gnome \
    && apt-get autoremove -y

RUN wget https://bootstrap.pypa.io/get-pip.py \
    && python3 get-pip.py \
    && python3 -m pip install unoserver

In the container I try to test connection between unoserver and unoconvert

unoserver &
wget http://www.africau.edu/images/default/sample.pdf
unoconvert sample.pdf smaple.txt

And unfortunately it doesn't work with error output:

INFO:unoserver:Starting unoconverter.
INFO:unoserver:Opening sample.pdf
Traceback (most recent call last):
  File "/usr/local/bin/unoconvert", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.10/dist-packages/unoserver/converter.py", line 247, in main
    result = converter.convert(
  File "/usr/local/lib/python3.10/dist-packages/unoserver/converter.py", line 185, in convert
    raise RuntimeError(
RuntimeError: Could not find an export filter from com.sun.star.drawing.DrawingDocument to generic_Text
regebro commented 1 year ago

You can't convert from PDF to text.