<html>
<head>
<base href="https://bugs.freedesktop.org/">
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - add a displayAnnot to Page class"
href="https://bugs.freedesktop.org/show_bug.cgi?id=83642#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - add a displayAnnot to Page class"
href="https://bugs.freedesktop.org/show_bug.cgi?id=83642">bug 83642</a>
from <span class="vcard"><a class="email" href="mailto:haxtibal@posteo.de" title="Tobias Deiminger <haxtibal@posteo.de>"> <span class="fn">Tobias Deiminger</span></a>
</span></b>
<pre>Whitespace changes are removed now. See rev. 2 of
<a href="https://gist.github.com/haxtibal/eab9320d43e47dfefe47249ee1e6d01a">https://gist.github.com/haxtibal/eab9320d43e47dfefe47249ee1e6d01a</a>. Sorry,
wanted to cleanup interleaved tabs and thought one could ignore changes during
review. But obviously the "?w=1" trick doesn't work for gists. Btw., if you
prefer we can shift the patch over to bugs.freedesktop.org anytime.
You'll probably find more to dislike. I do, just had no better ideas yet. Some
reasoning in advance:
The changes around Qt5SplashOutputDev/ArthurOutputDev [0] are a bit heavy and
unfinished (dislike!). But I wanted to share as much "factory code" as possible
between Poppler::Page and Poppler::Annotation, thus factored out common stuff.
The changes regarding Annot::draw [1] are a bit heavy and unfinished (again
dislike). But I had to find a common place amongst all annotation types where
one can hook in to get the real size of the dynamically generated appearance
*1). Plus the template pattern approach hopefully helps poppler newbies like me
to understand things better, as it makes common steps in Annot::draw schematic
and explicit.
Regarding API... QImage Poppler::Annotation::renderToImage(double hDPI, double
vDPI) was the simplest API I could imagine. Functionality explicitly cares
about one single annotation and no other objects, thus the method is bound to
Annotation, instead of Page. We don't need to bother clients with position/size
arguments, poppler knows it all, and better. We probably don't need callbacks.
Maybe we want to allow fine tuning some rendering settings? E.g. an
enableTransparentBackground option could make sense to chose either page color
or transparency as background. Also a further method
Poppler::Annotation::renderToArthur(...) could be useful and would be
consistent to Poppler::Page::renderToArthur.
*1) Annot::rect and actual drawn size may differ. E.g. icons are forced to 24pt
regardless of what's in Annot::rect. A bug on it's own imho [2], but that's the
way it is for now.
[0]
<a href="https://gist.github.com/haxtibal/eab9320d43e47dfefe47249ee1e6d01a#file-poppler-render_individual_annots-patch-L2710">https://gist.github.com/haxtibal/eab9320d43e47dfefe47249ee1e6d01a#file-poppler-render_individual_annots-patch-L2710</a>
[1]
<a href="https://gist.github.com/haxtibal/eab9320d43e47dfefe47249ee1e6d01a#file-poppler-render_individual_annots-patch-L91">https://gist.github.com/haxtibal/eab9320d43e47dfefe47249ee1e6d01a#file-poppler-render_individual_annots-patch-L91</a>
[2] <a href="https://bugs.kde.org/show_bug.cgi?id=388458">https://bugs.kde.org/show_bug.cgi?id=388458</a></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>