From: Artur Adib Date: Wed, 18 Jan 2012 16:41:13 +0000 (-0500) Subject: Ensure single chars are added to the layer X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=5f4d462144747c19c9dd41facb7ed18d98202d40;p=pdf.js.git Ensure single chars are added to the layer --- diff --git a/web/viewer.js b/web/viewer.js index 72c154b..319946c 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -974,13 +974,13 @@ var TextLayerBuilder = function textLayerBuilder(textLayerDiv) { } var textDiv = textDivs.shift(); if (textDiv.dataset.textLength > 1) { // avoid div by zero - textLayerDiv.appendChild(textDiv); // Adjust div width (via letterSpacing) to match canvas text // Due to the .offsetWidth calls, this is slow textDiv.style.letterSpacing = ((textDiv.dataset.canvasWidth - textDiv.offsetWidth) / (textDiv.dataset.textLength - 1)) + 'px'; } + textLayerDiv.appendChild(textDiv); } renderTimer = setInterval(renderTextLayer, renderInterval);