unoconv / unoserver

MIT License
495 stars 69 forks source link

Ability to set --infilter #90

Closed jerbob92 closed 5 months ago

jerbob92 commented 9 months ago

Hi there!

I'm trying to convert PDFs to Docx using this tool, this seems posisble with libreoffice CLI using this command:

libreoffice --headless --infilter="writer_pdf_import" --convert-to docx --outdir /myfolder /myfolder/myfile.pdf

This results in a /myfolder/myfile.docx file.

When I use this tool with the following command:

unoconvert --convert-to docx /myfolder/myfile.pdf /myfolder/myfile.docx

It results in the following error:

RuntimeError: Could not find an export filter from com.sun.star.drawing.DrawingDocument to writer_MS_Word_2007

I believe this has to do with the infilter that I can set on the libreoffice command, but not on unoconvert. Would it be an idea to add support for this parameter?

BjoernPetersen commented 6 months ago

Would be really nice to have the option to override the infilter! If you pass indata instead of infile, LibreOffice will sometimes have trouble determining the input file format, because it can't look at the file name extension.

Examples are .wmf and .emf files, as well as Adobe Illustrator (.ai) files.

regebro commented 5 months ago

2.1b1 released with --input-filter argument added