Configuration
To use the pdf Plugin, you have to configure it first.
Copy the file “settings.conf.dist” from the directory “plugins/pdfPlugin/src/main/resources”, save it as “settings.conf” and adjust it as follows:
In order to start the conversion, you need to install the program wkhtmltopdf on your operation system. The path to the wkhtmltopdf executable must be stated in the “settings.conf” file. Furthermore you need two folders, one to file your template and the other for the temporary data during the conversion. You can either use relative or absolute paths for the folders.
For example:
pdfPlugin { storageDir = "templates" tempDir = "tmp" wkhtmltopdf = "C:/Program Files/wkhtmltopdf/bin/wkhtmltopdf.exe" } ....
NOTE:
If you use wkhtmltopdf on a Linux without the X11 Server, the error “wkhtmltopdf: cannot connect to X server” may occur.
In this case you need to install the program “xvfb” via the package manager to simulate the X11 server.
Create a wrapper (e.g. /usr/local/bin/wkhtmltopdf-xvfb) for the “wkhtmltopdf” program and write the path in the PdfPlugin Config.
<#!/bin/bash> xvfb-run --server-args="-screen 0, 1024x768x24"/usr/bin/wkhtmltopdf$*
Plugin Execution
The Plugin is located in the directory: plugins/pdfPlugins. It can be activated with the SBT/Activator via a “run” command. The STDIN command “stop” ends the Plugin execution.
You can adapt the logback-configuration file “plugins/pdfPlugin/src/main/resources/logback.xml” to configure the log output or display it in another file.