protected function pdf_setup()
{
try {
// By default, PDFs are rendered in a very low resolution.
// We want the thumbnail to be readable, so increase the rendering DPI.
$this->image->setResolution(128, 128);
// Only load the first page.
return $this->file . '[0]';
} catch (Exception $e) {
return new WP_Error('pdf_setup_failed', $e->getMessage(), $this->file);
}
}