Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Convert a PDF document to a preview image in PHP without installing Ghostscript

Tags:

php

pdf

This has been asked before but the answer is always to use ghost script. This isn't available on hosts using cPanel. Is it possible to do without Ghostscript extension installed?

like image 803
Will Avatar asked Nov 16 '11 02:11

Will


People also ask

How do I convert a PDF document to a preview image in PHP?

Step 1: Open the PHP coding environment and start by creating imagic object using the code. $imagick = new Imagick(); Step 2: Now read the image from the target PDF file using the code: $imagick->readImage('myfile.


1 Answers

Just a quick suggestion for those considering using an external service to achieve this: now, some APIs allow to upload documents and retrieve their related info, thumbnail, etc.

For instance see Cloudinary (which offers a free plan) : https://cloudinary.com/blog/uploading_converting_and_generating_thumbnails_for_pdf_documents

like image 113
O. NegEY Avatar answered Oct 12 '22 02:10

O. NegEY