ODT 2 PDF

Hi,

How do you convert an odt to pdf.

I have made a custom ODT for my invoice however the document that gets generated is in the ODT format and not in PDF format.

How do I get the pdf format?

Also, what is the font that is used in carbe pdf generation?

Hi,

If you want to convert odt to pdf, you need to activate the odt2pdf script
I do not find a tuto in english but you have some infos in here SOLVED: ODT to PDF

Okay, will check.

Do you know what would be the font that is used in default pdf generation.

That link contains information that is Latin and Greek to me. Will have to sit and figure it out. Would you be able to write a step by step solution?

Also the error I get is different.

This is the error I get after activating the MAIN_ODT_AS_PDF through Setup Other

Dolibarr has detected a technical error.
This information can be useful for diagnostic purposes (you can set option $dolibarr_main_prod to ‘1’ to remove such notices):
Date: 20190308100620
Dolibarr: 9.0.0
PHP: 7.0.33
Server: Apache/2.4.38 (cPanel) OpenSSL/1.0.2q mod_bwlimited/1.4 Phusion_Passenger/5.3.7
OS: Linux md-ht-2.webhostbox.net 2.6.32-896.16.1.lve1.4.54.el6.x86_64 #1 SMP Wed May 2 07:43:19 EDT 2018 x86_64
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:66.0) Gecko/20100101 Firefox/66.0

Requested URL: /erp/compta/facture/card.php?facid=16
Referer: https://www.attaritechnocrats.in/erp/compta/facture/card.php?facid=16&file=(PROV16)%2F(PROV16)_CGST_SGST_Invoice_format.odt&entity=1
Menu manager: eldy_menu.php

Database type manager: mysqli
Latest database access request error: No request in error
Return code for latest database access request error: No request in error
Information for latest database access request error: No request in error

Message: Error generating document for CommonObject. Error: ODT to PDF convert fail :

I have installed Dolibarr on my Linux based webserver.

What if I change the permission of my odf.php file located in /includes/odtphp/odf.php.

Currently it has 644 permission.

have you defined the
MAIN_ODT_AS_PDF â–ș Activate PDF conversion from ODT document.then
MAIN_DOL_SCRIPTS_ROOT Must also be defined to path where the “scripts” directory is stored (for example /var/www/mydolibarr).

This value should be defined in Scripts Other? I define the folder where my odf.php file is stored right?

Yes
MAIN_DOL_SCRIPTS_ROOT and value as example /var/www/mydolibarr

Still getting the same error. Do I have to upload any script file?

Like this one? https://framagit.org/Battant/dolibarr/blob/839f73d5687966e80e6d337c3aab5ce48b051e3a/scripts/odt2pdf/odt2pdf.sh

Uploaded the code on this link scripts/odt2pdf/odt2pdf.sh · 839f73d5687966e80e6d337c3aab5ce48b051e3a · Michaël Parchet / dolibarr · GitLab

Still getting the following error

Please help on this topic. I am stuck!!!

Please what do you mean by the script directory? do you mean the directory where the OTD templates are stored?

Please can you help me with this? I have dolibarr 12.03. I really want to be able to convert ODT documents to PDF and I also need to be able to include additional variables. Like include line that has a fraction of the total sum displayed on invoices.

Hi, the filepath to your dolibarr main files in field where you add value:
MAIN_DOL_SCRIPTS_ROOT then the value to filepath like this /var/www/yourweb/public_html/yourdolibarrmainfiles

hello, i have the same problem.
The conversion completes when I test it on the server. but after creating ODT file in dolibarr it comes with .odt extension.
I still haven’t been able to solve the problem.
thank you for your help

Doli version : 14.0.2
Server : Centos 7 - Cpanel/Whm
host: PHP version 7.4

I tried this solution published by ### h6585 . (of course all other solutions didn’t work)

https://github.com/Dolibarr/dolibarr/issues/10896
MAIN_DOL_SCRIPTS_ROOT = /home/xx/public_html/erp/scripts/odt2pdf/
MAIN_ODT_AS_PDF = pyodconverter

file dir : /home/xx/public_html/erp/scripts/odt2pdf

odt2pdf.zip (5.4 KB)

Host PHP-FPM setttings: exec,pasthru,shell_exec, system = allow

Server test:
[root@server1 odt2pdf]# ./odt2pdf.sh test pyodconverter
[root@server1 odt2pdf]#
result:
[root@server1 odt2pdf]# ls
DocumentConverter.py odt2pdf.sh #old_odt2pdf.sh test.odt test.pdf
[root@server1 odt2pdf]#
here the function does not work!

yes i finally found a solution thanks you priojk

Apache (Ea4) / WHM-Cpanel * install openoffice

wget Download Apache_OpenOffice_4.1.12_Linux_x86-64_install-rpm_en-US.tar.gz (Apache OpenOffice)

tar xzf Apache_OpenOffice_4.1.12_Linux_x86-64_install-rpm_en-US.tar.gz

cd en-US/RPMS/

rpm -Uvh *.rpm

then the above steps


now makes your ODT templates PDF on server side. Our purpose is clearly for mobile users and those who cannot read ODT documents and therefore without installation provisioning such as openoffice, libreoffice.

ODT documents on the other hand can be edited. however, digitally signed PDF documents cannot be modified. Of course, those who use Dolibar with their mobile phone/tablet can create and send all documents in mobilization.

it was not easy to reach this result and I had to check the above steps, many topics in the forum and even resources such as dithub.

I hope it will be useful to everyone. I would like to thank everyone who supported the very talented development, delivery and support of Dolibarr.

1 Like