Users can upload and share any type of file via the Documents and Media library, a customizable and permissions-enabled online repository for files (see publishing files for more information). PDFBox is included with Liferay DXP and generates automatic previews for certain file types (mostly PDFs). You can install two additional tools to generate previews for other file types:
-
OpenOffice: or LibreOffice: Convert and generate previews for many types of documents.
-
ImageMagick: Generate higher-quality image previews for many types of images.
-
Xuggler: Convert and generate previews for audio and video files.
As of Liferay 7.1, OpenOffice/LibreOffice is configured in OSGi Configuration
Admin instead of portal properties. To adjust the these settings, go to Control
Panel → Configuration → System Settings → Connectors →
OpenOffice Integration. You can also adjust these
settings by deploying a
com.liferay.document.library.document.conversion.internal.configuration.OpenOfficeConfiguration.config
file to your [Liferay Home]/osgi/configs
folder. See the
Breaking Changes
document for details.
Once you’ve installed ImageMagick and Xuggler, you can use the Server Administration app’s External Services tab to configure Liferay DXP to use them. Make sure to choose the correct versions of these tools for your operating system. Install the latest stable versions, as older versions may not run properly with Liferay DXP. ImageMagick must be installed manually, but you can install Xuggler from the Control Panel.
ImageMagick Configuration
Before configuring ImageMagick to generate image and PDF previews, install it and its dependency, Ghostscript. This differs by operating system: on Linux, both are likely already installed. They are not likely to be installed on Windows, but may be on macOS.
-
Download and install ImageMagick.
-
Download and install Ghostscript.
Once installed, you must enable ImageMagick in the Server Administration app’s
External Services tab, or in a portal-ext.properties
file. If using
portal-ext.properties
, add the following lines and make sure the search path
points to the directories containing the ImageMagick and Ghostscript
executables. You may also need to configure the path for fonts used by
Ghostscript when in macOS or Unix environments.
imagemagick.enabled=true
imagemagick.global.search.path[apple]=/opt/local/bin:/opt/local/share/ghostscript/fonts:/opt/local/share/fonts/urw-fonts
imagemagick.global.search.path[unix]=/usr/local/bin:/usr/local/share/ghostscript/fonts:/usr/local/share/fonts/urw-fonts
imagemagick.global.search.path[windows]=C:\\Program Files\\ImageMagick
Follow these steps to instead enable ImageMagick from the Server Administration app’s External Services tab:
-
In the Control Panel, navigate to Configuration → Server Administration, then click the External Services tab.
-
Expand the ImageMagick and Ghostscript section and select Enabled.
-
Verify that the paths to the ImageMagick and Ghostscript executables are correct.
- Set the Resource limits to use.
Xuggler Configuration
Follow these steps to install and configure Xuggler:
-
In the Control Panel, navigate to Configuration → Server Administration, then click the External Services tab.
-
In the Xuggler section, select the Xuggler
.jar
file that matches your operating system. Then click Install. -
Restart your application server.
-
Enable Xuggler for your portal. There are two ways to do this:
-
In the Control Panel, navigate to the Server Administration → External Services tab, select Enabled, then click Save.
-
Add the following line to your
portal-ext.properties
file and restart your application server:xuggler.enabled=true
-