breathing code

crib notes on technology

collective.pdfpeek 0.18: asynchronous processing of image preview generation

leave a comment »

The other day I released a Plone 4 compatible version of collective.pdfpeek in which I’ve implemented an asynchronous processing queue for pdf to image conversions. In the initial versions of pdfpeek, a user would be forced to wait for their pdf file to be processed, one page at a time, by ghostscript, before Plone returned a response to their browser. Talk about a bad user experience. Many PDF files are so large that this time spent waiting by the user became unacceptably long. So I’ve tried to work around this by implementing a simple queue where a conversion job is added to the queue when a PDF file is uploaded to a file object in Plone. One can then either process the queue manually by visiting a certain url as admin, or preferably by automating this process with cron and curl or via a zope clock server process. When the user uploads a PDF file, a conversion job is added to the queue and the user can then go about their business, adding or editing other content and return to the file object later to see the image previews available once the conversion job in the queue has been processed. collective.pdfpeek 0.18 works under Plone 3, but the integration doctests currently need some attention in order to get them passing on both Plone 3 and 4, so that is why version 0.18 only “officially” supports Plone 4.

Advertisement

Written by David Brenneman

March 3, 2010 at 22:25

Posted in hacking, software

Tagged with , , ,

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.