You are here

protected function MediaPdfThumbnailImageManager::generatePdfImage in Media PDF Thumbnail 8.4

Same name and namespace in other branches
  1. 8.3 src/Manager/MediaPdfThumbnailImageManager.php \Drupal\media_pdf_thumbnail\Manager\MediaPdfThumbnailImageManager::generatePdfImage()

Parameters

\Drupal\file\FileInterface $fileEntity:

Return value

bool|string|null

1 call to MediaPdfThumbnailImageManager::generatePdfImage()
MediaPdfThumbnailImageManager::createThumbnail in src/Manager/MediaPdfThumbnailImageManager.php

File

src/Manager/MediaPdfThumbnailImageManager.php, line 169

Class

MediaPdfThumbnailImageManager
Class MediaPdfThumbnailImageManager.

Namespace

Drupal\media_pdf_thumbnail\Manager

Code

protected function generatePdfImage(FileInterface $fileEntity) {
  $fileInfos = $this
    ->getFileInfos($fileEntity);
  if (!empty($fileInfos['source']) && !empty($fileInfos['destination'])) {
    return $this->mediaPdfThumbnailImagickManager
      ->generateImageFromPDF($fileInfos['source'], $fileInfos['destination']);
  }
  return NULL;
}