Skip to the content
Documentation

Setting up ezodf

No ratings yet

This page is for administrators. ezodf is installed with Exponential 6, and the setup wizard activates it for a new installation. It needs no database tables of its own. Everything else is done in the administration; no command line is needed after the activation.

Requirements

  • PHP 8.0 to 8.5 with the extensions zip and dom; curl to install LibreOffice from the administration and to read web addresses; proc_open allowed.
  • For the converter: Linux, and LibreOffice, either installed with one click from the administration (about 700 MB on disk below var/, no root rights needed) or from the packages of the system. bubblewrap (bwrap) runs it in a sandbox without network access.
  • The extension expqueue is recommended for the background jobs, with the cron job every installation runs every minute. Without it each job runs in a PHP process of its own.

Without LibreOffice, ezodf still reads OpenDocument texts, DOCX, spreadsheets, presentations, Markdown, HTML, plain text and the text of PDF files, and writes OpenDocument texts.

Activate it

  1. Add ActiveExtensions[]=ezodf under [ExtensionSettings] in settings/override/site.ini.append.php, if the wizard did not.
  2. Regenerate the autoloads and clear the caches.
  3. Give editors the rights ezodf/import and ezodf/export, and administrators ezodf/converter, in Users > Roles and policies.
php bin/php/ezpgenerateautoloads.php -e
php bin/php/ezcache.php --clear-tag=ini
php bin/php/ezcache.php --clear-tag=template

Set up the converter

Open Setup, Documents (Word, OpenDocument, PDF ...), then Document converter. The figures at the top show the LibreOffice in use and where it comes from, whether the conversion server runs, the result of the last test, the sandbox and the number of formats.

The top of the Document converter page with its status figures

Setup > Documents > Document converter: which LibreOffice is in use, whether the conversion server runs, and the last test.

  • Install LibreOffice downloads the newest build of The Document Foundation for Linux into the installation's own var folder. Before it is used, its SHA-256 checksum and its signature are checked; a file that fails is deleted. Check for a new version and Update do the same later. The LibreOffice of the system can be used instead.
  • The conversion server keeps LibreOffice running and converts one document after the other: a fraction of a second per document instead of several seconds. Turn it on, off or restart it on this page.
  • Run the test conversions converts sample Word, RTF, Excel, PowerPoint, OpenDocument and OpenOffice.org 1.x files and lists each result with its time.
  • Limits set the time per document, the largest document, how many conversions run at the same time and how long uploads and imports are kept. A remote conversion server (unoserver or Gotenberg) can be used instead of a local LibreOffice.

If the cron job that runs background jobs has not run for a while, the page says so and offers Run pending jobs now. Ask your hosting to run runcronjobs.php every minute.

Settings in odf.ini

Block Setting Shipped value Meaning
ODFImport DefaultImportClass article The class a document becomes when its parts match no registered class.
ODFImport DefaultImportImageClass image The class of imported images.
ODFImport RegisteredClassArray[] article, folder, image, documentation_page, blog_post The classes an import may create.
ODFExport UseTemplate, TemplateName, TemplateRepository true, ezpublish.ott, extension/ezodf/templates The Writer template exports are built on.
DocumentType AllowedTypes[], ConvertTypes[] odt; doc, docx, rtf, txt, html and more The formats read directly and the formats passed to the converter. A site override can narrow them.
<class> DefaultImportTitleAttribute, DefaultImportBodyAttribute, Attribute[] per class Which fields the parts of a document fill. See Creating a Word document to import.

Values changed on the Document converter page are kept in var/<site>/ezodf/settings.json and win over odf.ini.

Upgrading from ezodf 6

  • Install version 7 over 6, regenerate the autoloads and clear the caches. There is no update script and no change to the database.
  • The conversion daemon of the 4.x versions (scripts/daemon.php) is no longer needed. Sites that run it keep using it with odf.ini [ODFImport] ConversionDaemon=enabled; otherwise the new converter is used.
  • Roles that should open the Document converter page need the new right ezodf/converter.

Known limits

  • The right to create image items where the images of an imported document are placed is not checked separately.
  • Importing with PlaceImagesInMedia=true does not place the images properly.

Read more

Contributors

Comments

Add a comment

Comments are read by a moderator before they appear.