0

This code I use to convert xls to pdf file:

/usr/bin/libreoffice --headless --convert-to pdf $path --outdir $destinationDirectory

On localhost desktop with Xorg it works ok. Document converting to one page without problems. But on server pdf file will converting on 2 pages on first page it cut right side on second we can see this cut part.

Libreoffice version on localhost:

LibreOffice 5.2.2.2.0 20m0(Build:2)

Libreoffice version on server:

LibreOffice 5.2.2.2 20m0(Build:2)

johndoek
  • 101
  • 1
  • 9

2 Answers2

0

Problem silently fixed. I guess, it happened after install xorg-server on ubuntu-server. But not sure. Anyway, it no more problem for me.

johndoek
  • 101
  • 1
  • 9
0

Installing xorg-server does not solve the problem.

The original cause is related to fonts. If the document uses a font that is not in the environment you are using, there will be problems with page size when converting libreoffice. In my case libreoffice was run in the docker, and to work correctly I had to add the "Calibri" font (which was used in the documents) to the image docker :

mkdir /root/.fonts/
cd /root/.fonts/ 
wget -qO- http://plasmasturm.org/code/vistafonts-installer/vistafonts-installer | bash

After that, problems with page size ceased to be observed during conversion. In other cases the solution with other fonts will be similar.

Sprait
  • 1