[poppler] poppler/Annot.cc
Jeff Muizelaar
jrmuizel at kemper.freedesktop.org
Thu Oct 25 20:46:10 PDT 2007
poppler/Annot.cc | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
New commits:
commit 289679405ab143bc2106cf269227c514a1602e56
Author: Jeff Muizelaar <jeff at infidigm.net>
Date: Thu Oct 25 22:16:10 2007 -0400
Avoid drawing borders unless /W and /S are specified in /BS
Acroread doesn't sometimes doesn't draw borders when you'd
expect it to. Special case that behaviour so that we do the
same thing.
diff --git a/poppler/Annot.cc b/poppler/Annot.cc
index 850b729..2e09848 100644
--- a/poppler/Annot.cc
+++ b/poppler/Annot.cc
@@ -242,10 +242,19 @@ void Annot::initialize(XRef *xrefA, Dict *acroForm, Dict *dict, Catalog *catalog
borderType = annotBorderUnderlined;
}
}
- obj2.free();
- if (obj1.dictLookup("W", &obj2)->isNum()) {
- borderWidth = obj2.getNum();
+ if (obj1.dictLookup("W", &obj3)->isNum()) {
+ borderWidth = obj3.getNum();
+ }
+ // acroread 8 seems to need both W and S entries for
+ // any border to be drawn, even though the spec
+ // doesn't claim anything of that sort. We follow
+ // that behaviour by veryifying both entries exist
+ // otherwise we set the borderWidth to 0
+ // --jrmuizel
+ if (!obj2.isName() || !obj3.isNum()) {
+ borderWidth = 0;
}
+ obj3.free();
obj2.free();
if (obj1.dictLookup("D", &obj2)->isArray()) {
borderDashLength = obj2.arrayGetLength();
More information about the poppler
mailing list