From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jambunathan K Subject: Re: Extending ODT export Date: Wed, 22 May 2013 14:06:34 +0530 Message-ID: <87wqqrfm25.fsf@gmail.com> References: <162AA118-3C0D-4E3D-BA96-90CBB47003A0@ieee.org> <969F330B-BF74-4C3F-A166-13BE3DFF2EF6@ieee.org> <878v3q7xpi.fsf@med.uni-goettingen.de> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54220) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uf4Xf-0007T7-Qp for emacs-orgmode@gnu.org; Wed, 22 May 2013 04:37:08 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uf4XZ-0000pg-AE for emacs-orgmode@gnu.org; Wed, 22 May 2013 04:37:03 -0400 In-Reply-To: <878v3q7xpi.fsf@med.uni-goettingen.de> (Andreas Leha's message of "Wed, 08 May 2013 09:11:21 +0200") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Andreas Leha Cc: bug-gnu-emacs@gnu.org, emacs-orgmode@gnu.org doc-view (for OpenDocument files) uses the below mentioned work around. The fix can be ported to `org-odt.el' and `ox-odt.el'. --8<---------------cut here---------------start------------->8--- (defun doc-view-odf->pdf-converter-soffice (odf callback) "Convert ODF to PDF asynchronously and call CALLBACK when finished. The converted PDF is put into the current cache directory, and it is named like ODF with the extension turned to pdf." ;; FIXME: soffice doesn't work when there's another running ;; LibreOffice instance, in which case it returns success without ;; actually doing anything. See LibreOffice bug ;; https://bugs.freedesktop.org/show_bug.cgi?id=37531. A workaround ;; is to start soffice with a separate UserInstallation directory. (let ((tmp-user-install-dir (make-temp-file "libreoffice-docview" t))) (doc-view-start-process "odf->pdf" doc-view-odf->pdf-converter-program (list (concat "-env:UserInstallation=file://" tmp-user-install-dir) "--headless" "--convert-to" "pdf" "--outdir" (doc-view-current-cache-dir) odf) (lambda () (delete-directory tmp-user-install-dir t) (funcall callback))))) --8<---------------cut here---------------end--------------->8--- Andreas Leha writes: > I had problems to use LibreOffice to convert a *already open* document. So, > if you are viewing the doc in LibreOffice while you try your export, you > might run into problems. > > This is a reported bug in LibreOffice. The suggested work-around is to > use a temporary profile as in: > libreoffice "-env:UserInstallation=file:///tmp/LibO_Conversion" > --headless --invisible --convert-to txt:text "$FILENAME" >/dev/null > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > > You might try to add that to the conversion command and see whether it > helps.