1212 * See the License for the specific language governing permissions and
1313 * limitations under the License.
1414 */
15- /* globals PDFJS */
1615
1716'use strict' ;
1817
@@ -35,6 +34,7 @@ var addLinkAttributes = displayDOMUtils.addLinkAttributes;
3534var getFilenameFromUrl = displayDOMUtils . getFilenameFromUrl ;
3635var warn = sharedUtil . warn ;
3736var CustomStyle = displayDOMUtils . CustomStyle ;
37+ var getDefaultSetting = displayDOMUtils . getDefaultSetting ;
3838
3939/**
4040 * @typedef {Object } AnnotationElementParameters
@@ -107,6 +107,7 @@ var AnnotationElement = (function AnnotationElementClosure() {
107107 this . viewport = parameters . viewport ;
108108 this . linkService = parameters . linkService ;
109109 this . downloadManager = parameters . downloadManager ;
110+ this . imageResourcesPath = parameters . imageResourcesPath ;
110111
111112 if ( isRenderable ) {
112113 this . container = this . _createContainer ( ) ;
@@ -363,7 +364,7 @@ var TextAnnotationElement = (function TextAnnotationElementClosure() {
363364 var image = document . createElement ( 'img' ) ;
364365 image . style . height = this . container . style . height ;
365366 image . style . width = this . container . style . width ;
366- image . src = PDFJS . imageResourcesPath + 'annotation-' +
367+ image . src = this . imageResourcesPath + 'annotation-' +
367368 this . data . name . toLowerCase ( ) + '.svg' ;
368369 image . alt = '[{{type}} Annotation]' ;
369370 image . dataset . l10nId = 'text_annotation_type' ;
@@ -838,6 +839,7 @@ var FileAttachmentAnnotationElement = (
838839 * @property {Array } annotations
839840 * @property {PDFPage } page
840841 * @property {IPDFLinkService } linkService
842+ * @property {string } imageResourcesPath
841843 */
842844
843845/**
@@ -868,7 +870,9 @@ var AnnotationLayer = (function AnnotationLayerClosure() {
868870 page : parameters . page ,
869871 viewport : parameters . viewport ,
870872 linkService : parameters . linkService ,
871- downloadManager : parameters . downloadManager
873+ downloadManager : parameters . downloadManager ,
874+ imageResourcesPath : parameters . imageResourcesPath ||
875+ getDefaultSetting ( 'imageResourcesPath' )
872876 } ;
873877 var element = annotationElementFactory . create ( properties ) ;
874878 if ( element . isRenderable ) {
@@ -899,7 +903,5 @@ var AnnotationLayer = (function AnnotationLayerClosure() {
899903 } ;
900904} ) ( ) ;
901905
902- PDFJS . AnnotationLayer = AnnotationLayer ;
903-
904906exports . AnnotationLayer = AnnotationLayer ;
905907} ) ) ;
0 commit comments