Hello,
I have a downloads page with only pdf files, and the client wants to see thumbnails of the files in addition to download links. I'd like to know if it's possible to extract a thumbnail from the first page of a pdf file. I tried something like this but it returns the pdf icon link:
class Resource extends DataObject {
public static $db = array(
'Title'=>'Varchar(255)'
);
public static $has_one = array(
'PDF' => 'File',
'ResourcesPage' => 'ResourcesPage'
);
// Summary fields
public static $summary_fields = array(
'Thumbnail' => 'Thumbnail',
'Title' => 'Title'
);
public function getThumbnail() {
return $this->PDF()->CMSThumbnail();
}
any idea if I'm missing something here or anyway to accomplish this?
thanks