Merge pull request #6757 from timvandermeij/annotation-types

Implement constants for all annotation types
This commit is contained in:
Tim van der Meij 2015-12-15 15:52:55 +01:00
commit a6ba210c19
2 changed files with 27 additions and 4 deletions

View File

@ -515,6 +515,7 @@ var WidgetAnnotation = (function WidgetAnnotationClosure() {
var dict = params.dict;
var data = this.data;
data.annotationType = AnnotationType.WIDGET;
data.fieldValue = stringToPDFString(
Util.getInheritableProperty(dict, 'V') || '');
data.alternativeText = stringToPDFString(dict.get('TU') || '');
@ -573,7 +574,6 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
WidgetAnnotation.call(this, params);
this.data.textAlignment = Util.getInheritableProperty(params.dict, 'Q');
this.data.annotationType = AnnotationType.WIDGET;
this.data.hasHtml = !this.data.hasAppearance && !!this.data.fieldValue;
}

View File

@ -43,9 +43,32 @@ var ImageKind = {
};
var AnnotationType = {
WIDGET: 1,
TEXT: 2,
LINK: 3
TEXT: 1,
LINK: 2,
FREETEXT: 3,
LINE: 4,
SQUARE: 5,
CIRCLE: 6,
POLYGON: 7,
POLYLINE: 8,
HIGHLIGHT: 9,
UNDERLINE: 10,
SQUIGGLY: 11,
STRIKEOUT: 12,
STAMP: 13,
CARET: 14,
INK: 15,
POPUP: 16,
FILEATTACHMENT: 17,
SOUND: 18,
MOVIE: 19,
WIDGET: 20,
SCREEN: 21,
PRINTERMARK: 22,
TRAPNET: 23,
WATERMARK: 24,
THREED: 25,
REDACT: 26
};
var AnnotationFlag = {