Before continuing the “API saga” I needed to have an infrastructure to be able to load a bulk of documents and save them using a certain filter. For me the reason was mainly for testing purposes, however its very convenient for “bulk conversion” too.
The syntax is:
./soffice.bin -bulk [targetDir]/[filterName].[targetExt] [dir] ... [dir]
E.g. the following call will convert all *.odt documents from /home/freuter/tmp/ to “/home/freuter/tmp/out/*.doc” documents using the “MS Word 97” filter:
./soffice.bin -bulk "/home/freuter/tmp/out/MS Word 97.doc" /home/freuter/tmp/*.odt
This command will convert all ~/tmp/*.doc documents to ~/tmp/out/*.odt using the ODF converter:
./soffice.bin -bulk ~/tmp/out/writer8.odt ~/tmp/*.doc
And finally this call will convert all ~/tmp/*.doc document to ~/tmp/out/*.pdf PDF document using the “ writer_pdf_Export” filter:
./soffice.bin -bulk ~/tmp/out/writer_pdf_Export.pdf ~/tmp/*.doc
The patch is here. I additionally fixed a bug in the m_nRequestCount logic and I enabled it in the [Experimental] section.