Render a single annotation with Qt5 frontend
Submitted by Tobias Deiminger
Assigned to poppler-bugs
Link to original bug (#105796)
Description
This is the Qt double of bug 83642. It adds Annotation::renderToImage() and similar methods.
The patch series has following use cases in mind: -show realistic preview of icons in readers -WYSIWYG editing of free text annotations, e.g. typewriter -paint annotations while dragging them around (render page is expensive) -extract single annotations from PDF with a command line tool -enable composition of annotations in readers; quite tricky, due to blend mode, z-order and the ilk
Example usage: ... /* Generate image where annotation #0 is painted at offset (0,0) on transparent background. / Poppler::Annotation annot = pdfPage->annotations()[0]; QImage img = annot->renderToImage(myDpiX, myDpiY); ...
I'd recommend to fix bug 105692 along with these patches, to get the size right in all circumstances.