0

How i can convert first page of pdf to PNG whith PHP

16th Jul 2018, 4:49 AM
Gerardo Jaimes
Gerardo Jaimes - avatar
3 Réponses
0
why do you need to do it with php? it seems like a language ill suited for the task. you can just screenshot the first page and ta-da! it's a picture now
16th Jul 2018, 11:35 AM
hinanawi
hinanawi - avatar
0
what happens is that I have a web page in which I upload pdf files I want to show the image of each pdf as a cover or img in miniature and I need to know how to generate image of the first page of each file
16th Jul 2018, 1:55 PM
Gerardo Jaimes
Gerardo Jaimes - avatar
0
If you don't need to generate pg1 of each pdf as a png on the fly, then screenshot is the cheapest way to go or find a service that will happily do that for you. Much simpler. If you must do it at runtime, then maybe this will help: https://www.npmjs.com/package/pdf-image I haven't used it though, so I can't attest to its quality of craftsmanship.
17th Jul 2018, 4:57 AM
Janning⭐
Janning⭐ - avatar