views:

426

answers:

4

In a Flex/AIR application, I need to create snapshots (like big thumbnails) of local PDF files (one per page, if indicated).

Ideally, I would like to do it all on the client side (PDF is a public specification, albeit a REALLY COMPLICATED one).

I have read about an "Adobe plug-in" but I cannot find a specific piece of software that makes the HTMLLoader.pdfCapability report anything but ERROR_CANNOT_LOAD_READER. I hope to load the PDF and then move the bitmap data to an Image in order to save it.

Second choice is sending it off to a web service and getting a set of jpg files back.

Thanks

A: 

Did you look at the as3-pdfreader project?

HanClinto
+2  A: 

I would suggest generating the previews on the server side (as the HTMLLoader relies on the client having Adobe Reader installed), unless you can find a component that is capable of generating thumbnails and that does not introduce requirements for specific software to be installed on client machines.

If you're developing an in-house solution for use in your company and you control or can impose requirements for the applications installed on user machines, I guess it won't be that bad. But if you're targeting consumers, there's nothing more annoying than introducing dependencies. And it could turn your customers away from your application.

Also having it server-side is usually the preferred option, since you could persist your thumbnails and not have to generate them every single time (if that makes sense for your application) and you unload heavy processing tasks from your client application. Processing PDFs with large number of pages can be a heavy processing task.

Mircea Grelus
A: 

Doing this client-side probably isn't the best idea. It seems overly complicated, could be quite slow, and will require a few unnecessary dependencies. If you do it server-side you can convert the PDFs to images and then send down the image to the client-side. Converting PDFs to images is a relatively simple process if you use a third-party PDF library.

Rowan
A: 

There are loads of tools in loads of languages to do this server. As just one example have a look at http://www.jpedal.org/pdf_to_jpeg.php

You can also find lots of online conversion services.