Merge pull request #4768 from Snuffleupagus/issue-4766

Handle more cases of invalid line dash patterns in annotation borders
This commit is contained in:
Tim van der Meij 2014-05-12 22:40:46 +02:00
commit a27f51e37c

View File

@ -105,7 +105,12 @@ var Annotation = (function AnnotationClosure() {
// TODO: implement proper support for annotations with line dash patterns.
var dashArray = borderArray[3];
if (data.borderWidth > 0 && dashArray && isArray(dashArray)) {
if (data.borderWidth > 0 && dashArray) {
if (!isArray(dashArray)) {
// Ignore the border if dashArray is not actually an array,
// this is consistent with the behaviour in Adobe Reader.
data.borderWidth = 0;
} else {
var dashArrayLength = dashArray.length;
if (dashArrayLength > 0) {
// According to the PDF specification: the elements in a dashArray
@ -127,6 +132,7 @@ var Annotation = (function AnnotationClosure() {
}
}
}
}
this.appearance = getDefaultAppearance(dict);
data.hasAppearance = !!this.appearance;