[poppler] patch for a progress callback

Damian Stewart lists at damianstewart.com
Fri Jan 4 00:16:25 PST 2013


Hey all,

My wife makes makes generative images (http://liaworks.com) using openFrameworks and exports them to PDF documents for large-format printing (100cm width at 300dpi). She often ends up with 10MB pdf docs containing tens of thousands of lines that can take between 30 minutes and 2 hours to render at print resolution.

To make the experience less miserable I built a progress callback into poppler. It's integrated into Page::displaySlice. If a progress callback is passed, displaySlice() does a preprocessing step where it constructs a DummyOutputDev and asks Gfx to render to that dev, counting the number of operations performed. Then it performs the real render to the passed output dev, calling the progress callback for every operation with a progress percent (0..1), a page number and optional user data.

As far as the outwards-facing parts of Poppler are concerned, I have only added the progress callback to the poppler::page_renderer class in the C++ API. I can supply a demo application built using the C++ API if that helps.

Please find the patch attached; apologies if this is not the correct way to do submit patches. 

Thanks (Poppler is awesome!)
Damian

-------------- next part --------------
A non-text attachment was scrubbed...
Name: poppler-0.22.0-progressCallback.patch
Type: application/octet-stream
Size: 17701 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/poppler/attachments/20130104/7e266b23/attachment.obj>


More information about the poppler mailing list