Browse Source

Add Util functions to PDFJS.

Brendan Dahl 13 years ago
parent
commit
04c8d1454d
  1. 2
      src/util.js
  2. 2
      web/viewer.js

2
src/util.js

@ -76,7 +76,7 @@ function stringToBytes(str) { @@ -76,7 +76,7 @@ function stringToBytes(str) {
var IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];
var Util = (function UtilClosure() {
var Util = PDFJS.Util = (function UtilClosure() {
function Util() {}
Util.makeCssRgb = function Util_makeCssRgb(r, g, b) {

2
web/viewer.js

@ -787,7 +787,7 @@ var PageView = function pageView(container, pdfPage, id, scale, @@ -787,7 +787,7 @@ var PageView = function pageView(container, pdfPage, id, scale,
}
function createElementWithStyle(tagName, item) {
var rect = viewport.convertToViewportRectangle(item.rect);
rect = Util.normalizeRect(rect);
rect = PDFJS.Util.normalizeRect(rect);
var element = document.createElement(tagName);
element.style.left = Math.floor(rect[0]) + 'px';
element.style.top = Math.floor(rect[1]) + 'px';

Loading…
Cancel
Save