|
@@ -23,8 +23,8 @@
|
|
|
}
|
|
|
}(this, function (exports) {
|
|
|
'use strict';
|
|
|
- var pdfjsVersion = '1.6.406';
|
|
|
- var pdfjsBuild = 'd0893b0';
|
|
|
+ var pdfjsVersion = '1.6.411';
|
|
|
+ var pdfjsBuild = '017e9b9';
|
|
|
var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? document.currentScript.src : null;
|
|
|
var pdfjsLibs = {};
|
|
|
(function pdfjsWrapper() {
|
|
@@ -31288,6 +31288,15 @@
|
|
|
switch (fieldType) {
|
|
|
case 'Tx':
|
|
|
return new TextWidgetAnnotationElement(parameters);
|
|
|
+ case 'Btn':
|
|
|
+ if (parameters.data.radioButton) {
|
|
|
+ return new RadioButtonWidgetAnnotationElement(parameters);
|
|
|
+ } else if (parameters.data.checkBox) {
|
|
|
+ return new CheckboxWidgetAnnotationElement(parameters);
|
|
|
+ } else {
|
|
|
+ warn('Unimplemented button widget annotation: pushbutton');
|
|
|
+ }
|
|
|
+ break;
|
|
|
case 'Ch':
|
|
|
return new ChoiceWidgetAnnotationElement(parameters);
|
|
|
}
|
|
@@ -31555,6 +31564,45 @@
|
|
|
});
|
|
|
return TextWidgetAnnotationElement;
|
|
|
}();
|
|
|
+ var CheckboxWidgetAnnotationElement = function CheckboxWidgetAnnotationElementClosure() {
|
|
|
+ function CheckboxWidgetAnnotationElement(parameters) {
|
|
|
+ WidgetAnnotationElement.call(this, parameters, parameters.renderInteractiveForms);
|
|
|
+ }
|
|
|
+ Util.inherit(CheckboxWidgetAnnotationElement, WidgetAnnotationElement, {
|
|
|
+ render: function CheckboxWidgetAnnotationElement_render() {
|
|
|
+ this.container.className = 'buttonWidgetAnnotation checkBox';
|
|
|
+ var element = document.createElement('input');
|
|
|
+ element.disabled = this.data.readOnly;
|
|
|
+ element.type = 'checkbox';
|
|
|
+ if (this.data.fieldValue && this.data.fieldValue !== 'Off') {
|
|
|
+ element.setAttribute('checked', true);
|
|
|
+ }
|
|
|
+ this.container.appendChild(element);
|
|
|
+ return this.container;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return CheckboxWidgetAnnotationElement;
|
|
|
+ }();
|
|
|
+ var RadioButtonWidgetAnnotationElement = function RadioButtonWidgetAnnotationElementClosure() {
|
|
|
+ function RadioButtonWidgetAnnotationElement(parameters) {
|
|
|
+ WidgetAnnotationElement.call(this, parameters, parameters.renderInteractiveForms);
|
|
|
+ }
|
|
|
+ Util.inherit(RadioButtonWidgetAnnotationElement, WidgetAnnotationElement, {
|
|
|
+ render: function RadioButtonWidgetAnnotationElement_render() {
|
|
|
+ this.container.className = 'buttonWidgetAnnotation radioButton';
|
|
|
+ var element = document.createElement('input');
|
|
|
+ element.disabled = this.data.readOnly;
|
|
|
+ element.type = 'radio';
|
|
|
+ element.name = this.data.fieldName;
|
|
|
+ if (this.data.fieldValue === this.data.buttonValue) {
|
|
|
+ element.setAttribute('checked', true);
|
|
|
+ }
|
|
|
+ this.container.appendChild(element);
|
|
|
+ return this.container;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return RadioButtonWidgetAnnotationElement;
|
|
|
+ }();
|
|
|
var ChoiceWidgetAnnotationElement = function ChoiceWidgetAnnotationElementClosure() {
|
|
|
function ChoiceWidgetAnnotationElement(parameters) {
|
|
|
WidgetAnnotationElement.call(this, parameters, parameters.renderInteractiveForms);
|
|
@@ -54603,6 +54651,8 @@
|
|
|
switch (fieldType) {
|
|
|
case 'Tx':
|
|
|
return new TextWidgetAnnotation(parameters);
|
|
|
+ case 'Btn':
|
|
|
+ return new ButtonWidgetAnnotation(parameters);
|
|
|
case 'Ch':
|
|
|
return new ChoiceWidgetAnnotation(parameters);
|
|
|
}
|
|
@@ -55030,6 +55080,59 @@
|
|
|
});
|
|
|
return TextWidgetAnnotation;
|
|
|
}();
|
|
|
+ var ButtonWidgetAnnotation = function ButtonWidgetAnnotationClosure() {
|
|
|
+ function ButtonWidgetAnnotation(params) {
|
|
|
+ WidgetAnnotation.call(this, params);
|
|
|
+ this.data.checkBox = !this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
|
|
|
+ if (this.data.checkBox) {
|
|
|
+ if (!isName(this.data.fieldValue)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.data.fieldValue = this.data.fieldValue.name;
|
|
|
+ }
|
|
|
+ this.data.radioButton = this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);
|
|
|
+ if (this.data.radioButton) {
|
|
|
+ this.data.fieldValue = this.data.buttonValue = null;
|
|
|
+ var fieldParent = params.dict.get('Parent');
|
|
|
+ if (!isDict(fieldParent) || !fieldParent.has('V')) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var fieldParentValue = fieldParent.get('V');
|
|
|
+ if (!isName(fieldParentValue)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.data.fieldValue = fieldParentValue.name;
|
|
|
+ var appearanceStates = params.dict.get('AP');
|
|
|
+ if (!isDict(appearanceStates)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var normalAppearanceState = appearanceStates.get('N');
|
|
|
+ if (!isDict(normalAppearanceState)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var keys = normalAppearanceState.getKeys();
|
|
|
+ for (var i = 0, ii = keys.length; i < ii; i++) {
|
|
|
+ if (keys[i] !== 'Off') {
|
|
|
+ this.data.buttonValue = keys[i];
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Util.inherit(ButtonWidgetAnnotation, WidgetAnnotation, {
|
|
|
+ getOperatorList: function ButtonWidgetAnnotation_getOperatorList(evaluator, task, renderForms) {
|
|
|
+ var operatorList = new OperatorList();
|
|
|
+ if (renderForms) {
|
|
|
+ return Promise.resolve(operatorList);
|
|
|
+ }
|
|
|
+ if (this.appearance) {
|
|
|
+ return Annotation.prototype.getOperatorList.call(this, evaluator, task, renderForms);
|
|
|
+ }
|
|
|
+ return Promise.resolve(operatorList);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return ButtonWidgetAnnotation;
|
|
|
+ }();
|
|
|
var ChoiceWidgetAnnotation = function ChoiceWidgetAnnotationClosure() {
|
|
|
function ChoiceWidgetAnnotation(params) {
|
|
|
WidgetAnnotation.call(this, params);
|