display the cover page of a pdf document in jpg or png

E

Erwin

I would like to display in my app the image of the cover page af an
pdf document produced internnally within my app ( wich plugin should
be better ... ? pdfwrite ?... generally it will be a less than 2 pages
document)
on the home page I would like to display the cover pages as png or jpg
with a link to the document or another action...

thanks for your suggestions

erwin
 
T

Tim Hunter

Erwin said:
I would like to display in my app the image of the cover page af an
pdf document produced internnally within my app ( wich plugin should
be better ... ? pdfwrite ?... generally it will be a less than 2 pages
document)
on the home page I would like to display the cover pages as png or jpg
with a link to the document or another action...

thanks for your suggestions

erwin

RMagick can convert a PDF to either PNG or JPG. If you just want the
first page, add [0] to the file name when you read the PDF, i.e.

img = Magick::Image.read("mystuff.pdf[0]").first
img.resize!(how-big-you-want-your-image-to-be)
img.write("mystuff.png")
 
E

Erwin

Erwin said:
I would like to display in my app the image of the cover page af an
pdfdocument produced internnally within my app ( wich plugin should
be better ... ? pdfwrite ?... generally it will be a less than 2 pages
document)
on the home page I would like to display the cover pages as png or jpg
with a link to the document or another action...
thanks for your suggestions

RMagick can convert aPDFto either PNG or JPG. If you just want the
first page, add [0] to the file name when you read thePDF, i.e.

img = Magick::Image.read("mystuff.pdf[0]").first
img.resize!(how-big-you-want-your-image-to-be)
img.write("mystuff.png")

Thanks a lot ! that's exactly what I want to do...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top