diff --git a/bower.json b/bower.json index fdfd96751..2422f80f8 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.404", + "version": "1.5.406", "main": [ "build/pdf.js", "build/pdf.worker.js" diff --git a/build/pdf.combined.js b/build/pdf.combined.js index 14527c68d..0ad8e3cd1 100644 --- a/build/pdf.combined.js +++ b/build/pdf.combined.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.5.404'; -var pdfjsBuild = 'a75b020'; +var pdfjsVersion = '1.5.406'; +var pdfjsBuild = 'ffa9939'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -46547,9 +46547,17 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { switch (fn | 0) { case OPS.setFont: + // Optimization to ignore multiple identical Tf commands. + var fontNameArg = args[0].name, fontSizeArg = args[1]; + if (textState.font && fontNameArg === textState.fontName && + fontSizeArg === textState.fontSize) { + break; + } + flushTextContentItem(); - textState.fontSize = args[1]; - next(handleSetFont(args[0].name, null)); + textState.fontName = fontNameArg; + textState.fontSize = fontSizeArg; + next(handleSetFont(fontNameArg, null)); return; case OPS.setTextRise: flushTextContentItem(); @@ -46766,6 +46774,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { } var gStateFont = gState.get('Font'); if (gStateFont) { + textState.fontName = null; textState.fontSize = gStateFont[1]; next(handleSetFont(null, gStateFont[0])); return; @@ -47685,6 +47694,7 @@ var StateManager = (function StateManagerClosure() { var TextState = (function TextStateClosure() { function TextState() { this.ctm = new Float32Array(IDENTITY_MATRIX); + this.fontName = null; this.fontSize = 0; this.font = null; this.fontMatrix = FONT_IDENTITY_MATRIX; diff --git a/build/pdf.js b/build/pdf.js index b452248f9..adfc307e3 100644 --- a/build/pdf.js +++ b/build/pdf.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.5.404'; -var pdfjsBuild = 'a75b020'; +var pdfjsVersion = '1.5.406'; +var pdfjsBuild = 'ffa9939'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? diff --git a/build/pdf.worker.js b/build/pdf.worker.js index cc98f1a8d..5fe0584ee 100644 --- a/build/pdf.worker.js +++ b/build/pdf.worker.js @@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {})); // Use strict in our context only - users might not want it 'use strict'; -var pdfjsVersion = '1.5.404'; -var pdfjsBuild = 'a75b020'; +var pdfjsVersion = '1.5.406'; +var pdfjsBuild = 'ffa9939'; var pdfjsFilePath = typeof document !== 'undefined' && document.currentScript ? @@ -38192,9 +38192,17 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { switch (fn | 0) { case OPS.setFont: + // Optimization to ignore multiple identical Tf commands. + var fontNameArg = args[0].name, fontSizeArg = args[1]; + if (textState.font && fontNameArg === textState.fontName && + fontSizeArg === textState.fontSize) { + break; + } + flushTextContentItem(); - textState.fontSize = args[1]; - next(handleSetFont(args[0].name, null)); + textState.fontName = fontNameArg; + textState.fontSize = fontSizeArg; + next(handleSetFont(fontNameArg, null)); return; case OPS.setTextRise: flushTextContentItem(); @@ -38411,6 +38419,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() { } var gStateFont = gState.get('Font'); if (gStateFont) { + textState.fontName = null; textState.fontSize = gStateFont[1]; next(handleSetFont(null, gStateFont[0])); return; @@ -39330,6 +39339,7 @@ var StateManager = (function StateManagerClosure() { var TextState = (function TextStateClosure() { function TextState() { this.ctm = new Float32Array(IDENTITY_MATRIX); + this.fontName = null; this.fontSize = 0; this.font = null; this.fontMatrix = FONT_IDENTITY_MATRIX; diff --git a/package.json b/package.json index d0cc32a26..4023b1d57 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pdfjs-dist", - "version": "1.5.404", + "version": "1.5.406", "main": "build/pdf.js", "description": "Generic build of Mozilla's PDF.js library.", "keywords": [