PDF Thumbnailing with Google App Engine (Python)
Is it possible, using the python version of google app engine, to create a thumbnail of a PDF file?
The goal is for the user to be able to upload a PDF, and开发者_开发技巧 see it represented as a thumbnail on the page.
You may be able to use Google's imaging services directly, since PDFs are essentially images and PIL can do this, though I haven't tried it.
If the direct approach doesn't work, you may be able to use the following process:
- Save the PDF to the blobstore.
- Open its link.
- Obtain a snapshot of the displayed PDF using a service like http://www.websnapr.com/.
- Save that generated image into your blobstore.
No. This requires a PDF renderer, and to the best of my knowledge no such thing exists in pure-Python. You'll have to use an external service to generate thumbnails.
精彩评论