Report work without libreoffice installed?

Hi,
My server with my jar application is on a lxc ubuntu on Proxmox VE.

Very strange is that I can create a report without having libreoffice installed.

Look to the packages I have installed on lxc:
packages_installed.txt (51.1 KB)

but documentation say Report add-on use the LibreOffice

My template is a .docx file and the output is .pdf :thinking:

Hello Florin,

is it a list of installed packages using the package manager?
But, one can also install the software manually, unpack it to some directory, and add that path to the configuration, path variables, etc. I think this may be the case here.

Kind regards,
Mladen

Hello Mladen,

Also I not setting where is libreoffice installed with

jmix.reports.officePath 

how I do it in Cuba and documentation tell us for jmix

I attached the log after I push the Print button to create the report in pdf:
for develop
log_for_development_genedatabank.txt (59.8 KB)
log for production
log_for_production_genedatabank.txt (41.1 KB)

In development machine I have libreoffice and in production machine I not installed office using apt or manually.

Also I save the template with fonts used.

I am happy if work without libreoffice :partying_face:, but how? :thinking:

Checked the docs,

### jmix.reports.useOfficeForDocumentConversion

Turns on using LibreOffice to convert the report having DOCX template to HTML/PDF, which significantly increases the conversion accuracy.

Default value: `false`

It seems like for your combination of template and target works without :slight_smile:

2024-08-29T14:24:02.908193+03:00 server genedatabank[674]: 2024-08-29T14:24:02.907+03:00  INFO 674 --- [nio-8090-exec-6] o.d.o.contenttype.ContentTypeManager     : Detected WordProcessingML package
2024-08-29T14:24:02.911249+03:00 server genedatabank[674]: 2024-08-29T14:24:02.908+03:00  INFO 674 --- [nio-8090-exec-6] org.docx4j.openpackaging.io3.Load3       : Instantiated package of type org.docx4j.openp>
2024-08-29T14:24:02.918181+03:00 server genedatabank[674]: 2024-08-29T14:24:02.917+03:00  INFO 674 --- [nio-8090-exec-6] org.docx4j.utils.XPathFactoryUtil        : xpath implementation: org.apache.xpath.jaxp.X>

But your logs say they are missing some fonts and styles so you may try to see how it would look with LibreOffice.

Yes in server machine I not have the fonts used in template but if I save the template with fonts included the result look ok.
Another problem, if I add more fonts the result crash.
I check tomorrow again and I add more fonts and I put the log here and after that I configure to use libreoffice.
But is nice if works without libreoffice for not complicated report with not more 2-3 fonts.

Hi,

I found why I not have result in same case.
When the font used in template is not inserted in document the result fail because can’t change the font used with another font.

When not work:

Caused by: java.io.FileNotFoundException: /home/florin/.docx4all/temporary embedded fonts/1725000830683-Cantarell Extra Bold.ttf (Nu există un astfel de fișier sau director)

Nu există un astfel de fișier sau director=No such file or directory

when work the report have another font from Serif family:

2024-08-30T09:59:37.377+03:00  WARN 164486 --- [nio-8080-exec-5] org.docx4j.fonts.RunFontSelector         : Font 'Cantarell Extra Bold' is not mapped to a physical font.

With fonts included in document work every time, until now.

Now I investigate my office application how many fonts used for default document (save new documents with empty words/page):

LibreOffice TextMaker OnlyOffice
Symbol SimSun Calibri
Times New Roman Times New Roman Times New Roman
Arial Arial Arial
FreeSerif FreeSerif Cambia
Liberation Serif
FreeSans

Where fonts FreeSerif and FreeSans was added by me in default template document.

So OnlyOffice have only Arial font in theme1.xml file from docx (is archive file) and change to FreeSans and I add only FreeSans in fontTable.xml (deleted Cambia, Calibri and Times New Roman), off course this modification was made manually. This docx I have in plan to use for the future, if work off course

1 Like

So my conclusion is:

  1. For report add-on the LibreOffice is not a must, work without but with fonts saved in docx.
  2. After I installed LibreOffice and configure to be used was necessary to arrange the report template because the arrange on page was changed, also I inserted the font used in docx.

Now my configure in application.properties for LibreOffice is:

#######################
### FOR LIBREOFFICE ###
#######################

# Turns on using LibreOffice to convert the report having DOCX template to HTML/PDF
jmix.reports.useOfficeForDocumentConversion = true

# Path to LibreOffice
# for Ubuntu
# jmix.reports.officePath = /usr/lib/libreoffice/program
# for AlmaLinux
# jmix.reports.officePath = /usr/lib64/libreoffice/program
# or for both (idea take it from AlmaLinux distro)
jmix.reports.officePath = /usr/bin
# but is necessary to create if not exist next files, marked executable, in /usr/bin for Ubuntu or other distro
# for /usr/bin/oobase
##!/usr/bin/sh
#exec libreoffice --base "$@"
#
# for /usr/bin/oocalc
##!/usr/bin/sh
#exec libreoffice --calc "$@"
#
# for /usr/bin/oodraw
##!/usr/bin/sh
#exec libreoffice --draw "$@"
#
# for /usr/bin/ooffice
##!/usr/bin/sh
#exec libreoffice "$@"
#
# for /usr/bin/ooimpress
##!/usr/bin/sh
#exec libreoffice --impress "$@"
#
# for /usr/bin/ooviewdoc
##!/usr/bin/sh
#exec libreoffice --view "$@"
#
# for /usr/bin/oowriter
##!/usr/bin/sh
#exec libreoffice --writer "$@"
#
# If no X11 DISPLAY variable was set
jmix.reports.displayDeviceAvailable = false

#######################
### end LIBREOFFICE ###
#######################