@@ -22,8 +22,8 @@ if (typeof PDFJS === 'undefined') {
22
22
(typeof window !== 'undefined' ? window : this ).PDFJS = {};
23
23
}
24
24
25
- PDFJS .version = '1.2.43 ' ;
26
- PDFJS .build = '1672c77 ' ;
25
+ PDFJS .version = '1.2.83 ' ;
26
+ PDFJS .build = '1280b7b ' ;
27
27
28
28
(function pdfjsWrapper () {
29
29
// Use strict in our context only - users might not want it
@@ -1699,7 +1699,9 @@ PDFJS.disableWorker = (PDFJS.disableWorker === undefined ?
1699
1699
/**
1700
1700
* Path and filename of the worker file. Required when the worker is enabled in
1701
1701
* development mode. If unspecified in the production build, the worker will be
1702
- * loaded based on the location of the pdf.js file.
1702
+ * loaded based on the location of the pdf.js file. It is recommended that
1703
+ * the workerSrc is set in a custom application to prevent issues caused by
1704
+ * third-party frameworks and libraries.
1703
1705
* @var {string}
1704
1706
*/
1705
1707
PDFJS .workerSrc = (PDFJS .workerSrc === undefined ? null : PDFJS .workerSrc );
@@ -4875,16 +4877,13 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
4875
4877
var x = 0 , i ;
4876
4878
for (i = 0 ; i < glyphsLength ; ++i ) {
4877
4879
var glyph = glyphs [i ];
4878
- if (glyph === null ) {
4879
- // word break
4880
- x += fontDirection * wordSpacing ;
4881
- continue ;
4882
- } else if (isNum (glyph )) {
4880
+ if (isNum (glyph )) {
4883
4881
x += spacingDir * glyph * fontSize / 1000 ;
4884
4882
continue ;
4885
4883
}
4886
4884
4887
4885
var restoreNeeded = false ;
4886
+ var spacing = (glyph .isSpace ? wordSpacing : 0 ) + charSpacing ;
4888
4887
var character = glyph .fontChar ;
4889
4888
var accent = glyph .accent ;
4890
4889
var scaledX , scaledY , scaledAccentX , scaledAccentY ;
@@ -4928,7 +4927,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
4928
4927
}
4929
4928
}
4930
4929
4931
- var charWidth = width * widthAdvanceScale + charSpacing * fontDirection ;
4930
+ var charWidth = width * widthAdvanceScale + spacing * fontDirection ;
4932
4931
x += charWidth ;
4933
4932
4934
4933
if (restoreNeeded ) {
@@ -4973,18 +4972,14 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
4973
4972
4974
4973
for (i = 0 ; i < glyphsLength ; ++i ) {
4975
4974
glyph = glyphs [i ];
4976
- if (glyph === null ) {
4977
- // word break
4978
- this .ctx .translate (wordSpacing , 0 );
4979
- current .x += wordSpacing * textHScale ;
4980
- continue ;
4981
- } else if (isNum (glyph )) {
4975
+ if (isNum (glyph )) {
4982
4976
spacingLength = spacingDir * glyph * fontSize / 1000 ;
4983
4977
this .ctx .translate (spacingLength , 0 );
4984
4978
current .x += spacingLength * textHScale ;
4985
4979
continue ;
4986
4980
}
4987
4981
4982
+ var spacing = (glyph .isSpace ? wordSpacing : 0 ) + charSpacing ;
4988
4983
var operatorList = font .charProcOperatorList [glyph .operatorListId ];
4989
4984
if (!operatorList ) {
4990
4985
warn ('Type3 character \"' + glyph .operatorListId +
@@ -4999,7 +4994,7 @@ var CanvasGraphics = (function CanvasGraphicsClosure() {
4999
4994
this .restore ();
5000
4995
5001
4996
var transformed = Util .applyTransform ([glyph .width , 0 ], fontMatrix );
5002
- width = transformed [0 ] * fontSize + charSpacing ;
4997
+ width = transformed [0 ] * fontSize + spacing ;
5003
4998
5004
4999
ctx .translate (width , 0 );
5005
5000
current .x += width * textHScale ;
@@ -8291,10 +8286,8 @@ if (!PDFJS.workerSrc && typeof document !== 'undefined') {
8291
8286
// workerSrc is not set -- using last script url to define default location
8292
8287
PDFJS .workerSrc = (function () {
8293
8288
'use strict' ;
8294
- var scriptTagContainer = document .body ||
8295
- document .getElementsByTagName ('head' )[0 ];
8296
- var pdfjsSrc = scriptTagContainer .lastChild .src ;
8297
- return pdfjsSrc && pdfjsSrc .replace (/\.js$ /i , '.worker.js' );
8289
+ var pdfJsSrc = document .currentScript .src ;
8290
+ return pdfJsSrc && pdfJsSrc .replace (/\.js$ /i , '.worker.js' );
8298
8291
})();
8299
8292
}
8300
8293
0 commit comments