<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>What is Miklos hacking - unoconv</title><link>https://vmiklos.hu/blog/</link><description/><atom:link href="https://vmiklos.hu/blog/feeds/unoconv.rss.xml" rel="self"/><lastBuildDate>Fri, 07 Sep 2018 09:57:46 +0000</lastBuildDate><item><title>Custom user profiles with unoconv</title><link>https://vmiklos.hu/blog/unoconv-user-profile.html</link><description>&lt;div id="preamble"&gt;
&lt;div class="sectionbody"&gt;
&lt;div class="imageblock" style="text-align:center;"&gt;
&lt;div class="content"&gt;
&lt;img src="https://farm2.staticflickr.com/1859/43598513125_55bed46184_o.png" alt="https://farm2.staticflickr.com/1859/43598513125_55bed46184_o.png" /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;&lt;p&gt;Background: I was benchmarking Online vs jodconverter vs unoconv the other day
for Collabora&amp;#8217;s &lt;a href="https://www.collaboraoffice.com/document-conversion/"&gt;document
conversion&lt;/a&gt; page. One problem with measuring unoconv performance was that it
provided no ways to run multiple &lt;code&gt;unoconv&lt;/code&gt; processes in parallel, while the
underlying &lt;code&gt;soffice&lt;/code&gt; binary obviously allows this.&lt;/p&gt;&lt;/div&gt;
&lt;div class="paragraph"&gt;&lt;p&gt;So while &lt;code&gt;unoconv&lt;/code&gt; is not capable of launching the &lt;code&gt;soffice&lt;/code&gt; process in a chroot
(improves security), nor is capable of forking an already pre-initialized
&lt;code&gt;soffice&lt;/code&gt; process (improves performance, both are things Online can do for you),
there is no real reason why you should not be able to run multiple &lt;code&gt;unoconv&lt;/code&gt;
processes in parallel. The previously mentioned benchmarking would be quite
unfair if even this kind of multiprocessing would be ignored, but unoconv had
no way to specify a custom user profile, which has to be different for each
&lt;code&gt;soffice&lt;/code&gt; process.&lt;/p&gt;&lt;/div&gt;
&lt;div class="paragraph"&gt;&lt;p&gt;So I filed a &lt;a href="https://github.com/dagwieers/unoconv/pull/451"&gt;GitHub pull
request&lt;/a&gt; on 1st Jun, and finally it was merged on 10th Aug.&lt;/p&gt;&lt;/div&gt;
&lt;div class="paragraph"&gt;&lt;p&gt;Here is how you can use it for example:&lt;/p&gt;&lt;/div&gt;
&lt;div class="listingblock"&gt;
&lt;div class="content"&gt;
&lt;pre&gt;&lt;code&gt;unoconv --user-profile /tmp/tmpf_yreswi -f pdf --port 2002 test.txt&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;div class="admonitionblock"&gt;
&lt;table&gt;&lt;tr&gt;
&lt;td class="icon"&gt;
&lt;div class="title"&gt;Note&lt;/div&gt;
&lt;/td&gt;
&lt;td class="content"&gt;It&amp;#8217;s your responsibility to give --port a unique value, but that&amp;#8217;s not
too hard: if you use a thread pool to launch the &lt;code&gt;unoconv&lt;/code&gt; processes, then you
can add the thread index to a base port and that will give you a unique port.&lt;/td&gt;
&lt;/tr&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div class="paragraph"&gt;&lt;p&gt;So this is available in unoconv master (towards unoconv 0.8.2+1), you can grab
the sources from git and try it out right now. :-)&lt;/p&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Miklos Vajna</dc:creator><pubDate>Fri, 07 Sep 2018 09:57:46 +0000</pubDate><guid>tag:vmiklos.hu,2018-09-07:/blog/unoconv-user-profile.html</guid><category>unoconv</category><category>en</category><category>libreoffice</category></item></channel></rss>