Server-side Export Configuration
The Java SDK uses some native components for exporting dashboards to different formats: Image, PDF, PPT and Excel.
For exporting images we use Playwright for Java.
For exporting PDF, PPT and Excel documents we use ExportTool (our own native application).
Getting ready to export
The first time a Dashboard is opened, both Playwright and ExportTool trigger the required downloads automatically. But for some platforms there are some dependencies that need to be installed in advance, and also your server environment might restrict external downloads and you might need to setup these tools manually.
Playwright automatically downloads the required binaries. But if manual configuration is required or you want to understand better how it works (or how to tweak it), you can check Playwright documentation here.
The only required library for macOS is libgdiplus, you can check installation information here.
There are dependencies to multiple native libraries in Linux. The exact list of dependencies you need to install depends on the distribution used, the version, and list of packages previously installed.
Below there's a list of libraries needed for a basic Ubuntu 18.0.4 distribution:
sudo apt-get update sudo apt-get install -y libgdiplus\ libatk1.0-0\ libatk-bridge2.0-0\ libxkbcommon0\ libxcomposite1\ libxdamage1\ libxfixes3\ libxrandr2\ libgbm1\ libgtk-3-0\ libpango-1.0-0\ libcairo2\ libgdk-pixbuf2.0-0\ libatspi2.0-0 sudo apt-get install -y --no-install-recommends xvfb
If needed, you can get more information about the missing libraries from errors included in the log file.
Please note that Ubuntu requires the following extra step (which also requires Maven).
mvn exec:java -e -Dexec.mainClass=com.microsoft.playwright.CLI -Dexec.args="install-deps chromium"
For other environments, you might also have to install:
sudo apt-get install -y --allow-unauthenticated libc6-dev sudo apt-get install -y --allow-unauthenticated libx11-dev
ExportTool Manual Setup
The instructions below are required only in the following scenarios:
- You're having issues with the automatic download mechanism
- You want to have everything pre-installed in advance.
- Download the required binaries for your platform: Windows, Linux or macOS.
- Unzip the file to a directory in your server, where your Web Application is running (your user should be able to access that directory).
After extracting the zip file, you can get the ExportTool at this location: <dir>/<version>/<arch>/ExportTool, for example:
While initializing Reveal, set the directory where you extracted the zip file. Should be similar to the following code snippet:
String exportToolDir = "<dir>"; RevealEngineInitializer.initialize( new InitializeParameterBuilder() .setAuthProvider(new UpmediaAuthenticationProvider()) .setUserContextProvider(new UpmediaUserContextProvider()) .setDashboardProvider(new UpmediaDashboardProvider()) .setLicense("SERIAL_KEY_TO_BE_USED") .setExportToolContainerPath(exportToolDir) .build());
Alternatively, you can specify the directory through the system property reveal.exportToolContainerPath, as shown below:
java -Dreveal.exportToolContainerPath=<dir> -jar target/upmedia-backend-spring.war