This function allows to show an image preview of a PDF file in attachments for tickets and knowledge base articles. This is helpful to display the content of a PDF without downloading the file.
Additionally the package offers the possibility for an image preview in dynamic fields of type attachment (for PDF files).
Note
To use this feature, ImageMagick should be installed on the server that runs STORM.
Setup
-
Download and install ImageMagick. In the most recent versions of ImageMagick, the usage of PDF file is restricted. In order to allow the usage of PDF it is needed to update the ImageMagick configuration manually.
-
Search for the file
/usr/local/etc/ImageMagick-7/policy.xml
(file path might vary depending on the ImageMagick version). -
Check if the file contains a
PDF
entry and that this entry is not marked as comment. -
Check if the entry contains at least
read
rights.<policy domain="coder" rights="read" pattern="PDF" />
-
Go to the system configuration and search for the setting
Magick::Bin
. -
Acivate the setting and enter the file path to the ImageMagick binary.
-
Open the
$OTRS_HOME/Kernel/Config.pm
and add the programs to the allow list.$Self->{'SystemConfiguration::ValueType::SystemCommand::BinaryWhiteList'}->{'001-OTRSSTORM'} = [ 'magick', 'pkcs15-tool', ];
-
Rebuild the system configuration.
Usage
After installation of the package, the Attachments widget now displays an icon for the PDF files in the Preview column in addition to the regular ones for images, audio and video files.
To see an image preview of the PDF:
-
Open the ticket detail view or the knowledge base article detail view.
-
Click on the preview icon for a PDF file in the Attachments widget.
The PDF is now displayed as an image in a small preview window. In case of, that the file is not really a PDF, the preview window displays nothing. In this case it is recommended not to download the PDF.
Note
The displayed image of the PDF contains only the first page of the PDF.
Dynamic Fields of Type Attachment
If the Dynamic Field Attachment feature is installed and a dynamic field has been added to a property card, the dynamic field contains an additional preview icon next to the download icon.
The PDF image preview can be used with this feature whereever a dynamic field of type attachment is added to the system.