SOLVED: ODT to PDF

Hi all,
im having issues converting ODT to PDF I get the following

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: 20180918032557
Dolibarr: 8.0.0
Level of features: 0
PHP: 7.0.30-0+deb9u1
Server: Apache/2.4.25 (Raspbian)
OS: Linux raspberrypi 4.14.50-v7+ #1122 SMP Tue Jun 19 12:26:26 BST 2018 armv7l
UserAgent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36

Requested URL: /compta/facture/card.php?facid=1
Referer: http://192.168.1.9/compta/facture/card.php?facid=1&file=(PROV1)%2F(PROV1)_Cover_Letter.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 :

My setting are as follows
MAIN_DOL_SCRIPTS_ROOT /var/www/html/scripts

MAIN_ODT_AS_PDF jodconverter

i looked on the forum and did find the pyconverter but i get the exact same issue

the file permissions are 777 as this is run only on a local computer

Any Ideas?

Hello

Have you tried upgrading to v8.0.1?

I’m installing update as i type. Was this a known bug and fixed in this latest version?

After update i get this

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: 20180918210126
Dolibarr: 8.0.1
Level of features: 0
PHP: 7.0.30-0+deb9u1
Server: Apache/2.4.25 (Raspbian)
OS: Linux raspberrypi 4.14.50-v7+ #1122 SMP Tue Jun 19 12:26:26 BST 2018 armv7l
UserAgent: Mozilla/5.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Raspbian Chromium/65.0.3325.181 Chrome/65.0.3325.181 Safari/537.36

Requested URL: /compta/facture/card.php?facid=1
Referer: http://localhost/compta/facture/card.php?facid=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: Error during file export addFromString content

Not sure, but minor releases are always fixes to bugs or security updates which is why I suggested it.

Hello,
I presume that you see this recommendation :

As you are on a ARM platform and that this converter is an external tool, you have to check that this tool is available on your system, i.E. you should have java and jodconverter.jar.
Where is your reference to pyconverter? Did you follow another tutorial?
Then, you have to be sure that Dolibarr find them.
You can activate logs registration in Setup / Modules to perhaps have more explicit messages of the error.

Hi,
Yes I have got all of the above I used apt-get to install jodconverter and it works sight from the command line.

All settings are correct as you have stated

And what say the logs?

When I tired to run the bash script both failed as in original and one from pyconverter version… I’m moving away from the pyconverter vision as its python 2 not 3… I’ll set up logs once I’m home all above it what I tested early this morning.

Thanks

Im now home and can try and sort this out…

What logs would you like? My first post had the main error.

I have installed jodconverter via apt im happy to use that as python requires chanes to make it py3 compadible. Ill just used the otd2pdf.sh that is shipped with 8.0.1

if i goto /var/www/html/scripts/odt2pdf

 sh odt2pdf.sh test
odt2pdf.sh: 15: [: xtest: unexpected operator
odt2pdf.sh: 37: [: x: unexpected operator
odt2pdf.sh: 64: [: x: unexpected operator
odt2pdf.sh: 68: [: x: unexpected operator
Error: Invalid or corrupt jarfile test.odt
Error while converting odt to pdf: 1

so im guesing the bash script may be broken

What will be interesting is to get which command is launched from Dolibarr, and which paths are used for get and output documents. And then, is there the return code and a specific error message from jodconverter.

The error logging in the bash script is very vague as is the procedure in odtphp.php file (yes i had a play with that).
also jodconverter works solo in terminal so we can rule that out

Sorry, didn’t see your complement.
I don’t have “unexpected operator”.
Can you try with bash instead of sh ?

So if i run

 bash odt2pdf test jodcoveter

That works

Thus, the problem seems to either in jodconverter, or in how it is called.
What is surprising is that it seems to try to consider test.odt as a jar file, which is not, of course.
Do you confirm that
jodconverter test.odt
is running?

bash odt2pdf.sh test jodconverter Sep 19, 2018 7:17:22 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection connect INFO: connected Sep 19, 2018 7:17:23 PM com.artofsolving.jodconverter.openoffice.connection.AbstractOpenOfficeConnection disposing INFO: disconnected

So that works not sure if edit was up before your post… So why wont it run in dolibarr?

The script of v8.0.1 is new according to v7. The difference starts from this commit:


Thus, I presume there is a bug in how the command is built.
This command is registered in logs. This is why I ask you to activate the logs in Setup/Module.

Sure how do i activate logs? is it MAIN_ENABLE_LOG with value of 1?

Where do i find the outputs?

How strange… ive just tired to generate again form dolibarr and now it works?

Wonder if i had to run bash first for some reason?

Ill drop back to 8.0.0 odt2pdf.sh and see if error is in there

Seems running as bash has fixed issue… not sure how or why but…

Thankyou for your help yves57

For logs, go to Setup - Modules - and System logs at bottom. By default you get them in a file dolibarr.log in htdocs.
The only difference I can imagine is that the openoffice server is now launched. But error messages weren’t related to server not running…