0

I am trying to use libreoffice to convert different source formats to pdf. This works with most formats but image formats are always interpreted as text:

libreoffice --headless --convert-to pdf:writer_pdf_Export hdr1.jpeg
// console output: convert /home/dev/hdr1.jpeg -> /home/dev/hdr1.pdf using filter : writer_pdf_Export

The following libreoffice verison is installed (Ubuntu 20.04):

libreoffice --version
LibreOffice 6.4.7.2 40(Build:2)

The resulting file hdr1.pdf does not contain the image but its binary data interpreted as text. I also tried the same with unoconv which results in the same problem.

Is there a special flag required to make libreoffice interpret images as images and not as text?

Regards,

7
  • I have added the libreoffice version.
    – Hyndrix
    Jul 1, 2021 at 17:44
  • And the output of file hdr1.jpeg. To see what the system thinks that file is. Jul 1, 2021 at 17:50
  • It returns hdr1.jpeg: JPEG image data, JFIF standard 1.01, resolution (DPI), density 72x72, segment length 16, Exif Standard: [TIFF image data, little-endian, direntries=10, manufacturer=Canon, model=Canon EOS 350D DIGITAL, orientation=upper-left, xresolution=164, yresolution=172, resolutionunit=2, software=easyHDR PRO 2.11.1beta16, datetime=2011:06:14 15:10:42], baseline, precision 8, 870x580, components 3.
    – Hyndrix
    Jul 1, 2021 at 17:59
  • 1
    You could try running lodraw instead of libreoffice. Jul 1, 2021 at 18:09
  • 1
    Thanks @Hyndrix, I just did. I added a bit more information so that it can be more broad and maybe help other users. Jul 2, 2021 at 14:03

1 Answer 1

1

libreoffice is a suite of applications. When executed with a file as a parameter, it will try to guess the type of file and open the corresponding application:

   lobase
   localc
   lodraw
   lofromtemplate
   loimpress
   lomath
   loweb
   lowriter

If the application is not there, then it might default to lowriter.

Check if you have the libre-office application you want to use and install it if you do not.

$ lodraw

or

$ libreoffice --draw

if it is not found you can do the following in Debian/Ubuntu:

$ sudo apt-get install libreoffice-draw

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .