Merge pull request #4768 from Snuffleupagus/issue-4766
Handle more cases of invalid line dash patterns in annotation borders
This commit is contained in:
commit
a27f51e37c
@ -105,7 +105,12 @@ var Annotation = (function AnnotationClosure() {
|
|||||||
|
|
||||||
// TODO: implement proper support for annotations with line dash patterns.
|
// TODO: implement proper support for annotations with line dash patterns.
|
||||||
var dashArray = borderArray[3];
|
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;
|
var dashArrayLength = dashArray.length;
|
||||||
if (dashArrayLength > 0) {
|
if (dashArrayLength > 0) {
|
||||||
// According to the PDF specification: the elements in a dashArray
|
// According to the PDF specification: the elements in a dashArray
|
||||||
@ -127,6 +132,7 @@ var Annotation = (function AnnotationClosure() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.appearance = getDefaultAppearance(dict);
|
this.appearance = getDefaultAppearance(dict);
|
||||||
data.hasAppearance = !!this.appearance;
|
data.hasAppearance = !!this.appearance;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user