PDF Image Preview

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

  1. 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.

  2. Search for the file /usr/local/etc/ImageMagick-7/policy.xml (file path might vary depending on the ImageMagick version).

  3. Check if the file contains a PDF entry and that this entry is not marked as comment.

  4. Check if the entry contains at least read rights.

    <policy domain="coder" rights="read" pattern="PDF" />
    
  5. Go to the system configuration and search for the setting Magick::Bin.

  6. Acivate the setting and enter the file path to the ImageMagick binary.

  7. 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',
    ];
    
  8. 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.

Preview Column in Attachments Widget

Preview Column in Attachments Widget

To see an image preview of the PDF:

  1. Open the ticket detail view or the knowledge base article detail view.

  2. 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.

Property Card with Dynamic Field of Type Attachment

Property Card with Dynamic Field of Type Attachment

The PDF image preview can be used with this feature whereever a dynamic field of type attachment is added to the system.

Scroll to Top