tags:

views:

56

answers:

1

Im trying to create a board game generator in ruby which takes images from one pdf and places them them on the tiles of the board-game template pdf. One image per tile.

I'm wondering what tools would be good for this in ruby. Ive looked at prawn and that seems great for creating the board game but i don't think i can use that for extracting images from the source pdfs.

Can anyone provide any ideas?

Extra info: Currently my knowledge of how pdfs are created and formed is v.limited so this may not make sense or matter but just in case... The source pdfs have one image per page. I haven't created the source pdfs / images so I cant determine how the pdf was authored i.e. is the image just plain text e.g. "Take a card" or is it some fancy adobe illustrator vector.

the images will always be re-sized smaller and image quality inst a priority - as long as it looks good to average user its fine.

+1  A: 

take a look at this thread for some ideas on reading pdfs

http://stackoverflow.com/questions/773193/ruby-reading-pdf-files

For writing PDFs, I recommend http://github.com/jdpace/PDFKit, it is a nice wrapper around wkhtmltopdf. It allows you to generate html with css and create a pdf directly from it. It saves hours of time compared to trying to format everything in prawn.

Geoff Lanotte
thanks for those links. PDFKit might be just what im looking for.
adam