@ -68,10 +68,12 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
* @ param { Object } ref
* @ param { Object } ref
* @ param { string } uniquePrefix
* @ param { string } uniquePrefix
* @ param { Object } idCounters
* @ param { Object } idCounters
* @ param { boolean } renderInteractiveForms
* @ returns { Annotation }
* @ returns { Annotation }
* /
* /
create : function AnnotationFactory _create ( xref , ref ,
create : function AnnotationFactory _create ( xref , ref ,
uniquePrefix , idCounters ) {
uniquePrefix , idCounters ,
renderInteractiveForms ) {
var dict = xref . fetchIfRef ( ref ) ;
var dict = xref . fetchIfRef ( ref ) ;
if ( ! isDict ( dict ) ) {
if ( ! isDict ( dict ) ) {
return ;
return ;
@ -90,6 +92,7 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
ref : isRef ( ref ) ? ref : null ,
ref : isRef ( ref ) ? ref : null ,
subtype : subtype ,
subtype : subtype ,
id : id ,
id : id ,
renderInteractiveForms : renderInteractiveForms ,
} ;
} ;
switch ( subtype ) {
switch ( subtype ) {
@ -693,6 +696,8 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
function TextWidgetAnnotation ( params ) {
function TextWidgetAnnotation ( params ) {
WidgetAnnotation . call ( this , params ) ;
WidgetAnnotation . call ( this , params ) ;
this . renderInteractiveForms = params . renderInteractiveForms ;
// Determine the alignment of text in the field.
// Determine the alignment of text in the field.
var alignment = Util . getInheritableProperty ( params . dict , 'Q' ) ;
var alignment = Util . getInheritableProperty ( params . dict , 'Q' ) ;
if ( ! isInt ( alignment ) || alignment < 0 || alignment > 2 ) {
if ( ! isInt ( alignment ) || alignment < 0 || alignment > 2 ) {
@ -715,12 +720,18 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
Util . inherit ( TextWidgetAnnotation , WidgetAnnotation , {
Util . inherit ( TextWidgetAnnotation , WidgetAnnotation , {
getOperatorList : function TextWidgetAnnotation _getOperatorList ( evaluator ,
getOperatorList : function TextWidgetAnnotation _getOperatorList ( evaluator ,
task ) {
task ) {
var operatorList = new OperatorList ( ) ;
// Do not render form elements on the canvas when interactive forms are
// enabled. The display layer is responsible for rendering them instead.
if ( this . renderInteractiveForms ) {
return Promise . resolve ( operatorList ) ;
}
if ( this . appearance ) {
if ( this . appearance ) {
return Annotation . prototype . getOperatorList . call ( this , evaluator , task ) ;
return Annotation . prototype . getOperatorList . call ( this , evaluator , task ) ;
}
}
var operatorList = new OperatorList ( ) ;
// Even if there is an appearance stream, ignore it. This is the
// Even if there is an appearance stream, ignore it. This is the
// behaviour used by Adobe Reader.
// behaviour used by Adobe Reader.
if ( ! this . data . defaultAppearance ) {
if ( ! this . data . defaultAppearance ) {