3

Is there anyway to generate a thumbnail image for the first page of an uploaded PDF file. I want to display this image along with the description (provided by the user) of the file.

pgmura
  • 708
  • 5
  • 16

2 Answers2

2

The first answer from this question looks like it'll do what you want.

Community
  • 1
  • 1
mopoke
  • 10,555
  • 1
  • 31
  • 31
0

You can use an image processing library like ImageMagick to convert a PDF into an image.

Call out to the system with something like:

system("convert -size 150x150 /path/to/uploaded/document.pdf /path/to/thumbnail/file.png")
wesgarrison
  • 6,975
  • 5
  • 30
  • 39