PDF results thumbnails
Generating thumbnail images for PDF results
Last updated
Generating thumbnail images for PDF results
Last updated
Ajax Search Pro is equipped with code to generate preview thumbnails for PDF results. However this requires a properly configured Imagick library.
Under the Search Sources -> Image settings panel make sure to enable the Generate thumbnails for PDF files?
option.
The steps below must be executed via SSH command line on your server. Needless to say, you should be very careful, and always do complete server backups before initializing the commands.
Installation varies from system to system, we are going to follow a guide for a Ubuntu server with apache and PHP 8, which is the most commonly used system. For the complete guide please check this article.
After logging in via SSH to your system, first make sure every package is up to date:
Chances are, that Imagick is already installed, run this command to verify:
If you get "imagick" on the output, then Imagick is installed, you can proceed to the next chapter.
Installing Imagick for PHP (replace the string "8.0" with the major PHP version you are using)
Open up your php.ini configuration file, usually located at /etc/php/8.0/apache2/php.ini
You can use an external editor, or via SSH:
The extension may be enabled already, look for this line:
If this line does not exist, then add it after the [PHP] section. Save the file with CTRL+O and exit after saving CTRL+X.
After finished, restart apache:
Imagick by default does not allow opening PDF files, this has to be enabled with a simple change to a single file.
Open up \etc\ImageMagick-6\policy.xml in a file editor or via SSH:
Close to the end of the file you should see this line:
Change that line to:
Save the file with CTRL+O and exit after saving CTRL+X.
That's it, after this configuration the PDF files should have a preview image generated in the live search results list.