From baa84fc4000fb3175bd4e35de442c03127c7cbd2 Mon Sep 17 00:00:00 2001 From: Artur Adib Date: Wed, 25 Apr 2012 11:02:02 -0400 Subject: [PATCH 1/4] removing Makefile, updating README --- Makefile | 344 ------------------------------------------------------ README.md | 9 +- 2 files changed, 5 insertions(+), 348 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index d95841000..000000000 --- a/Makefile +++ /dev/null @@ -1,344 +0,0 @@ -REPO = git@github.com:mozilla/pdf.js.git -BUILD_DIR := build -BUILD_TARGET := $(BUILD_DIR)/pdf.js -DEFAULT_BROWSERS := resources/browser_manifests/browser_manifest.json -DEFAULT_TESTS := test_manifest.json -DEFAULT_PYTHON := python2.7 - -EXTENSION_SRC := ./extensions/ -EXTENSION_BASE_VERSION := f0f0418a9c6637981fe1182b9212c2d592774c7d -FIREFOX_EXTENSION_NAME := pdf.js.xpi -FIREFOX_AMO_EXTENSION_NAME := pdf.js.amo.xpi -CHROME_EXTENSION_NAME := pdf.js.crx - -all: bundle - -# Let folks define custom rules for their clones. --include local.mk - -# JS files needed for pdf.js. -PDF_JS_FILES = \ - core.js \ - util.js \ - api.js \ - canvas.js \ - obj.js \ - function.js \ - charsets.js \ - cidmaps.js \ - colorspace.js \ - crypto.js \ - evaluator.js \ - fonts.js \ - glyphlist.js \ - image.js \ - metrics.js \ - parser.js \ - pattern.js \ - stream.js \ - worker.js \ - ../external/jpgjs/jpg.js \ - jpx.js \ - bidi.js \ - metadata.js \ - $(NULL) - -# make server -# -# This target starts a local web server at localhost:8888. This can be -# used for testing all browsers. -server: - @cd test; $(DEFAULT_PYTHON) test.py --port=8888; - -# make test -# -# This target runs all the tests excluding the unit-test. This can be used for -# testing all browsers. -test: shell-test browser-test - -# -# Create production output (pdf.js, and corresponding changes to web files) -# -production: | bundle - @echo "Preparing web/viewer-production.html"; \ - cd web; \ - sed '/PDFJSSCRIPT_REMOVE_CORE/d' viewer.html > viewer-1.tmp; \ - sed '/PDFJSSCRIPT_INCLUDE_BUILD/ r viewer-snippet.html' viewer-1.tmp > viewer-production.html; \ - rm -f *.tmp; \ - cd .. - -# -# Bundle pdf.js -# -bundle: | $(BUILD_DIR) - @echo "Bundling source files into $(BUILD_TARGET)" - @cd src; \ - cat $(PDF_JS_FILES) > all_files.tmp; \ - sed '/PDFJSSCRIPT_INCLUDE_ALL/ r all_files.tmp' pdf.js > ../$(BUILD_TARGET); \ - cp ../$(BUILD_TARGET) ../$(BUILD_TARGET).bak; \ - sed "s/PDFJSSCRIPT_BUNDLE_VER/`git log --format="%h" -n 1`/" ../$(BUILD_TARGET).bak > ../$(BUILD_TARGET); \ - rm -f ../$(BUILD_TARGET).bak; \ - rm -f *.tmp; \ - cd .. - -# make unit-test -# -# This target runs in-browser unit tests with our test framework and the -# jasmine unit test framework. -unit-test: - cd test; \ - $(DEFAULT_PYTHON) test.py --unitTest \ - --browserManifestFile=$(PDF_BROWSERS) - -# make browser-test -# -# This target runs in-browser tests using two primary arguments: a -# test manifest file, and a browser manifest file. Both are simple -# JSON formats, and examples can be found in the test/ directory. The -# target will inspect the environment for the PDF_TESTS and -# PDF_BROWSERS variables, and use those if found. Otherwise, the -# defaults at the top of this file are used. -ifeq ($(PDF_TESTS),) -PDF_TESTS := $(DEFAULT_TESTS) -endif -ifeq ($(PDF_BROWSERS),) -PDF_BROWSERS := $(DEFAULT_BROWSERS) -endif - -browser-test: - @if [ ! -f "test/$(PDF_BROWSERS)" ]; then \ - echo "Browser manifest file $(PDF_BROWSERS) does not exist."; \ - echo "Try copying one of the examples" \ - "in test/resources/browser_manifests/"; \ - exit 1; \ - fi; - - cd test; \ - $(DEFAULT_PYTHON) test.py --reftest \ - --browserManifestFile=$(PDF_BROWSERS) \ - --manifestFile=$(PDF_TESTS) - -# # make shell-test -# # -# # This target runs all of the tests that can be run in a JS shell. -# # The shell used is taken from the JS_SHELL environment variable. If -# # that variable is not defined, the script will attempt to use the copy -# # of Rhino that comes with the Closure compiler used for producing the -# # website. -# SHELL_TARGET = $(NULL) -# ifeq ($(JS_SHELL),) -# JS_SHELL := "java -cp $(BUILD_DIR)/compiler.jar" -# JS_SHELL += "com.google.javascript.jscomp.mozilla.rhino.tools.shell.Main" -# SHELL_TARGET = compiler -# endif -# -# shell-test: shell-msg $(SHELL_TARGET) font-test -# shell-msg: -# ifeq ($(SHELL_TARGET), compiler) -# @echo "No JS_SHELL env variable present." -# @echo "The default is to find a copy of Rhino and try that." -# endif -# @echo "JS shell command is: $(JS_SHELL)" -# -# font-test: -# @echo "font test stub." - -# make lint -# -# This target runs the Closure Linter on most of our JS files. -# To install gjslint, see: -# -# -SRC_DIRS := src utils web test examples/helloworld extensions/firefox \ - extensions/firefox/components extensions/chrome test/unit -GJSLINT_FILES = $(foreach DIR, $(SRC_DIRS), $(wildcard $(DIR)/*.js)) -lint: - gjslint --nojsdoc $(GJSLINT_FILES) - -# make web -# -# This target produces the website for the project, by checking out -# the gh-pages branch underneath the build directory, and then move -# the various viewer files into place. -# -# TODO: Use the Closure compiler to optimize the pdf.js files. -# -GH_PAGES = $(BUILD_DIR)/gh-pages -web: | production extension compiler pages-repo - @cp $(BUILD_TARGET) $(GH_PAGES)/$(BUILD_TARGET) - @cp -R web/* $(GH_PAGES)/web - @cp web/images/* $(GH_PAGES)/web/images - @cp $(FIREFOX_BUILD_DIR)/$(FIREFOX_EXTENSION_NAME) \ - $(FIREFOX_BUILD_DIR)/$(FIREFOX_AMO_EXTENSION_NAME) \ - $(FIREFOX_BUILD_DIR)/update.rdf \ - $(GH_PAGES)/$(EXTENSION_SRC)/firefox/ - @cp $(GH_PAGES)/web/index.html.template $(GH_PAGES)/index.html; - @mv -f $(GH_PAGES)/web/viewer-production.html $(GH_PAGES)/web/viewer.html; - @cd $(GH_PAGES); git add -A; - @echo - @echo "Website built in $(GH_PAGES)." - @echo "Don't forget to cd into $(GH_PAGES)/ and issue 'git commit' to push changes." - -# make pages-repo -# -# This target clones the gh-pages repo into the build directory. It -# deletes the current contents of the repo, since we overwrite -# everything with data from the master repo. The 'make web' target -# then uses 'git add -A' to track additions, modifications, moves, -# and deletions. -pages-repo: | $(BUILD_DIR) - @if [ ! -d "$(GH_PAGES)" ]; then \ - git clone --depth 1 -b gh-pages $(REPO) $(GH_PAGES); \ - rm -rf $(GH_PAGES)/*; \ - fi; - @mkdir -p $(GH_PAGES)/web; - @mkdir -p $(GH_PAGES)/web/images; - @mkdir -p $(GH_PAGES)/build; - @mkdir -p $(GH_PAGES)/$(EXTENSION_SRC)/firefox; - -# # make compiler -# # -# # This target downloads the Closure compiler, and places it in the -# # build directory. This target is also useful when the user doesn't -# # have a JS shell available--we can have them use the Rhino shell that -# # comes with Closure. -# COMPILER_URL = http://closure-compiler.googlecode.com/files/compiler-latest.zip -# -# compiler: $(BUILD_DIR)/compiler.zip -# $(BUILD_DIR)/compiler.zip: | $(BUILD_DIR) -# curl $(COMPILER_URL) > $(BUILD_DIR)/compiler.zip; -# cd $(BUILD_DIR); unzip compiler.zip compiler.jar; - -# make extension -# -# This target produce a restartless firefox extension containing a -# copy of the pdf.js source. -CONTENT_DIR := content -BUILD_NUMBER := `git log --format=oneline $(EXTENSION_BASE_VERSION).. | wc -l | awk '{print $$1}'` -PDFJSSCRIPT_VERSION := 0.3.$(BUILD_NUMBER) -EXTENSION_WEB_FILES = \ - web/images \ - web/viewer.css \ - web/viewer.js \ - web/viewer.html \ - web/viewer-production.html \ - web/debugger.js \ - $(NULL) - -FIREFOX_BUILD_DIR := $(BUILD_DIR)/firefox -FIREFOX_BUILD_CONTENT := $(FIREFOX_BUILD_DIR)/$(CONTENT_DIR)/ -FIREFOX_CONTENT_DIR := $(EXTENSION_SRC)/firefox/$(CONTENT_DIR)/ -FIREFOX_EXTENSION_FILES_TO_COPY = \ - *.js \ - *.rdf \ - *.png \ - install.rdf.in \ - README.mozilla \ - components \ - ../../LICENSE \ - $(NULL) -FIREFOX_EXTENSION_FILES = \ - bootstrap.js \ - install.rdf \ - icon.png \ - icon64.png \ - components \ - content \ - LICENSE \ - $(NULL) -FIREFOX_MC_EXTENSION_FILES = \ - bootstrap.js \ - icon.png \ - icon64.png \ - components \ - content \ - LICENSE \ - $(NULL) - -CHROME_BUILD_DIR := $(BUILD_DIR)/chrome -CHROME_CONTENT_DIR := $(EXTENSION_SRC)/chrome/$(CONTENT_DIR)/ -CHROME_BUILD_CONTENT := $(CHROME_BUILD_DIR)/$(CONTENT_DIR)/ -CHROME_EXTENSION_FILES = \ - extensions/chrome/*.json \ - extensions/chrome/*.html \ - $(NULL) -extension: | production - # Clear out everything in the firefox extension build directory - @rm -Rf $(FIREFOX_BUILD_DIR) - @mkdir -p $(FIREFOX_BUILD_CONTENT) - @mkdir -p $(FIREFOX_BUILD_CONTENT)/$(BUILD_DIR) - @mkdir -p $(FIREFOX_BUILD_CONTENT)/web - @cd extensions/firefox; cp -r $(FIREFOX_EXTENSION_FILES_TO_COPY) ../../$(FIREFOX_BUILD_DIR)/ - # Copy a standalone version of pdf.js inside the content directory - @cp $(BUILD_TARGET) $(FIREFOX_BUILD_CONTENT)/$(BUILD_DIR)/ - @cp -r $(EXTENSION_WEB_FILES) $(FIREFOX_BUILD_CONTENT)/web/ - @rm $(FIREFOX_BUILD_CONTENT)/web/viewer-production.html - # Copy over the firefox extension snippet so we can inline pdf.js in it - @cp web/viewer-snippet-firefox-extension.html $(FIREFOX_BUILD_CONTENT)/web/ - # Modify the viewer so it does all the extension only stuff. - @cd $(FIREFOX_BUILD_CONTENT)/web; \ - cp viewer-snippet-firefox-extension.html viewer-snippet-firefox-extension.html.bak; \ - sed '/PDFJSSCRIPT_INCLUDE_BUNDLE/ r ../build/pdf.js' viewer-snippet-firefox-extension.html.bak > viewer-snippet-firefox-extension.html; \ - cp viewer.html viewer.html.bak; \ - sed '/PDFJSSCRIPT_REMOVE_CORE/d' viewer.html.bak > viewer.html; \ - cp viewer.html viewer.html.bak; \ - sed '/PDFJSSCRIPT_REMOVE_FIREFOX_EXTENSION/d' viewer.html.bak > viewer.html; \ - cp viewer.html viewer.html.bak; \ - sed '/PDFJSSCRIPT_INCLUDE_FIREFOX_EXTENSION/ r viewer-snippet-firefox-extension.html' viewer.html.bak > viewer.html; \ - rm -f *.bak; - # We don't need pdf.js anymore since its inlined - @rm -Rf $(FIREFOX_BUILD_CONTENT)/$(BUILD_DIR)/; - # Update the build version number - cp $(FIREFOX_BUILD_DIR)/install.rdf $(FIREFOX_BUILD_DIR)/install.rdf.bak - @sed "s/PDFJSSCRIPT_VERSION/$(PDFJSSCRIPT_VERSION)/" $(FIREFOX_BUILD_DIR)/install.rdf.bak > $(FIREFOX_BUILD_DIR)/install.rdf - cp $(FIREFOX_BUILD_DIR)/install.rdf.in $(FIREFOX_BUILD_DIR)/install.rdf.in.bak - @sed "s/PDFJSSCRIPT_VERSION/$(PDFJSSCRIPT_VERSION)/" $(FIREFOX_BUILD_DIR)/install.rdf.in.bak > $(FIREFOX_BUILD_DIR)/install.rdf.in - cp $(FIREFOX_BUILD_DIR)/update.rdf $(FIREFOX_BUILD_DIR)/update.rdf.bak - @sed "s/PDFJSSCRIPT_VERSION/$(PDFJSSCRIPT_VERSION)/" $(FIREFOX_BUILD_DIR)/update.rdf.bak > $(FIREFOX_BUILD_DIR)/update.rdf - cp $(FIREFOX_BUILD_DIR)/README.mozilla $(FIREFOX_BUILD_DIR)/README.mozilla.bak - @sed "s/PDFJSSCRIPT_VERSION/$(PDFJSSCRIPT_VERSION)/" $(FIREFOX_BUILD_DIR)/README.mozilla.bak > $(FIREFOX_BUILD_DIR)/README.mozilla - @rm -f $(FIREFOX_BUILD_DIR)/*.bak - @find $(FIREFOX_BUILD_DIR) -name ".*" -delete - # Create the xpi - @cd $(FIREFOX_BUILD_DIR); zip -r $(FIREFOX_EXTENSION_NAME) $(FIREFOX_EXTENSION_FILES) - @echo "extension created: " $(FIREFOX_EXTENSION_NAME) - # Build the amo extension too (remove the updateUrl) - cp $(FIREFOX_BUILD_DIR)/install.rdf $(FIREFOX_BUILD_DIR)/install.rdf.bak - @sed "/updateURL/d" $(FIREFOX_BUILD_DIR)/install.rdf.bak > $(FIREFOX_BUILD_DIR)/install.rdf - @rm -f $(FIREFOX_BUILD_DIR)/*.bak - @cd $(FIREFOX_BUILD_DIR); zip -r $(FIREFOX_AMO_EXTENSION_NAME) $(FIREFOX_EXTENSION_FILES) - @echo "AMO extension created: " $(FIREFOX_AMO_EXTENSION_NAME) - # List all files for mozilla-central - @cd $(FIREFOX_BUILD_DIR); find $(FIREFOX_MC_EXTENSION_FILES) -type f > extension-files - - # Clear out everything in the chrome extension build directory - @rm -Rf $(CHROME_BUILD_DIR) - @mkdir -p $(CHROME_BUILD_CONTENT) - @mkdir -p $(CHROME_BUILD_CONTENT)/$(BUILD_DIR) - @mkdir -p $(CHROME_BUILD_CONTENT)/web - @cp -R $(CHROME_EXTENSION_FILES) $(CHROME_BUILD_DIR)/ - # Copy a standalone version of pdf.js inside the content directory - @cp $(BUILD_TARGET) $(CHROME_BUILD_CONTENT)/$(BUILD_DIR)/ - @cp -r $(EXTENSION_WEB_FILES) $(CHROME_BUILD_CONTENT)/web/ - @mv -f $(CHROME_BUILD_CONTENT)/web/viewer-production.html $(CHROME_BUILD_CONTENT)/web/viewer.html - - # Create the crx - #TODO - - - -# Make sure there's a build directory. -$(BUILD_DIR): - mkdir -p $(BUILD_DIR) - -clean: - rm -rf $(BUILD_DIR) - -# make help -# -# This target just prints out a message to read these comments. :) -help: - @echo "Read the comments in the Makefile for guidance."; - -.PHONY:: production test browser-test font-test shell-test \ - shell-msg lint clean web compiler help server diff --git a/README.md b/README.md index 4c6fc1e18..9c242d0b8 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ Also, note that the development extension is updated on every merge and by defau auto-update extensions on a daily basis (you can change this through the `extensions.update.interval` option in `about:config`). -For an experimental Chrome extension, get the code as explained below and issue `make extension`. +For an experimental Chrome extension, get the code as explained below and issue `node make extension`. Then open Chrome, go to `Tools > Extension` and load the (unpackaged) extension from the directory `build/chrome`. @@ -50,9 +50,10 @@ To get a local copy of the current code, clone it using git: Next, you need to start a local web server as some browsers don't allow opening PDF files for a file:// url: - $ make server + $ node make server -If everything worked out, you can now serve +You can install Node via [nvm](https://github.com/creationix/nvm) or the +[official package](http://nodejs.org). If everything worked out, you can now serve + http://localhost:8888/web/viewer.html @@ -64,7 +65,7 @@ You can also view all the test pdf files on the right side serving In order to bundle all `src/` files into a final `pdf.js`, issue: - $ make + $ node make bundle This will generate the file `build/pdf.js` that can be included in your final project. (WARNING: That's a large file! Consider minifying it). From 2b81f3c2e96e229d2a70fdc530524975cfad5543 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=A4rcker?= Date: Thu, 26 Apr 2012 13:28:38 +0200 Subject: [PATCH 2/4] changed load order to fix viewer in Opera locally --- src/worker_loader.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/worker_loader.js b/src/worker_loader.js index 69eb1414f..6d92a95e7 100644 --- a/src/worker_loader.js +++ b/src/worker_loader.js @@ -23,9 +23,9 @@ var files = [ 'pattern.js', 'stream.js', 'worker.js', - '../external/jpgjs/jpg.js', 'jpx.js', - 'bidi.js' + 'bidi.js', + '../external/jpgjs/jpg.js' ]; // Load all the files. From 889b3d31687dcf6ccfed55c8ff5841a5001d1beb Mon Sep 17 00:00:00 2001 From: Kalervo Kujala Date: Tue, 1 May 2012 20:48:07 +0300 Subject: [PATCH 3/4] Correct class method names. --- src/api.js | 30 +++++++++++++++--------------- src/obj.js | 2 +- src/pattern.js | 2 +- src/util.js | 2 +- 4 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/api.js b/src/api.js index 3d97dacd2..32c49c363 100644 --- a/src/api.js +++ b/src/api.js @@ -69,14 +69,14 @@ var PDFDocumentProxy = (function() { * @return {Promise} A promise that is resolved with a {PDFPageProxy} * object. */ - getPage: function(number) { + getPage: function PDFDocumentProxy_getPage(number) { return this.transport.getPage(number); }, /** * @return {Promise} A promise that is resolved with a lookup table for * mapping named destinations to reference numbers. */ - getDestinations: function() { + getDestinations: function PDFDocumentProxy_getDestinations() { var promise = new PDFJS.Promise(); var destinations = this.pdfInfo.destinations; promise.resolve(destinations); @@ -97,7 +97,7 @@ var PDFDocumentProxy = (function() { * ... * ]. */ - getOutline: function() { + getOutline: function PDFDocumentProxy_getOutline() { var promise = new PDFJS.Promise(); var outline = this.pdfInfo.outline; promise.resolve(outline); @@ -109,7 +109,7 @@ var PDFDocumentProxy = (function() { * available in the information dictionary and similarly metadata is a * {Metadata} object with information from the metadata section of the PDF. */ - getMetadata: function() { + getMetadata: function PDFDocumentProxy_getMetadata() { var promise = new PDFJS.Promise(); var info = this.pdfInfo.info; var metadata = this.pdfInfo.metadata; @@ -119,7 +119,7 @@ var PDFDocumentProxy = (function() { }); return promise; }, - destroy: function() { + destroy: function PDFDocumentProxy_destroy() { this.transport.destroy(); } }; @@ -169,7 +169,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() { * @return {PageViewport} Contains 'width' and 'height' properties along * with transforms required for rendering. */ - getViewport: function(scale, rotate) { + getViewport: function PDFPageProxy_getViewport(scale, rotate) { if (arguments.length < 2) rotate = this.rotate; return new PDFJS.PageViewport(this.view, scale, rotate, 0, 0); @@ -178,7 +178,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() { * @return {Promise} A promise that is resolved with an {array} of the * annotation objects. */ - getAnnotations: function() { + getAnnotations: function PDFPageProxy_getAnnotations() { if (this.annotationsPromise) return this.annotationsPromise; @@ -198,7 +198,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() { * @return {Promise} A promise that is resolved when the page finishes * rendering. */ - render: function(params) { + render: function PDFPageProxy_render(params) { this.renderInProgress = true; var promise = new Promise(); @@ -257,8 +257,8 @@ var PDFPageProxy = (function PDFPageProxyClosure() { * For internal use only. */ startRenderingFromOperatorList: - function PDFPageWrapper_startRenderingFromOperatorList(operatorList, - fonts) { + function PDFPageProxy_startRenderingFromOperatorList(operatorList, + fonts) { var self = this; this.operatorList = operatorList; @@ -279,7 +279,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() { /** * For internal use only. */ - ensureFonts: function PDFPageWrapper_ensureFonts(fonts, callback) { + ensureFonts: function PDFPageProxy_ensureFonts(fonts, callback) { this.stats.time('Font Loading'); // Convert the font names to the corresponding font obj. for (var i = 0, ii = fonts.length; i < ii; i++) { @@ -299,7 +299,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() { /** * For internal use only. */ - display: function PDFPageWrapper_display(gfx, viewport, callback) { + display: function PDFPageProxy_display(gfx, viewport, callback) { var stats = this.stats; stats.time('Rendering'); @@ -331,7 +331,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() { /** * Stub for future feature. */ - getTextContent: function() { + getTextContent: function PDFPageProxy_getTextContent() { var promise = new PDFJS.Promise(); var textContent = 'page text'; // not implemented promise.resolve(textContent); @@ -340,7 +340,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() { /** * Stub for future feature. */ - getOperationList: function() { + getOperationList: function PDFPageProxy_getOperationList() { var promise = new PDFJS.Promise(); var operationList = { // not implemented dependencyFontsID: null, @@ -352,7 +352,7 @@ var PDFPageProxy = (function PDFPageProxyClosure() { /** * Destroys resources allocated by the page. */ - destroy: function() { + destroy: function PDFPageProxy_destroy() { this.destroyed = true; if (!this.renderInProgress) { diff --git a/src/obj.js b/src/obj.js index 47aed8f8a..9b99eb8f7 100644 --- a/src/obj.js +++ b/src/obj.js @@ -39,7 +39,7 @@ var Dict = (function DictClosure() { // Map should only be used internally, use functions below to access. var map = Object.create(null); - this.assignXref = function Dict_assingXref(newXref) { + this.assignXref = function Dict_assignXref(newXref) { xref = newXref; }; diff --git a/src/pattern.js b/src/pattern.js index 7659f5436..8d69d3a92 100644 --- a/src/pattern.js +++ b/src/pattern.js @@ -110,7 +110,7 @@ Shadings.RadialAxial = (function RadialAxialClosure() { var r1 = raw[6]; return { type: 'Pattern', - getPattern: function(ctx) { + getPattern: function RadialAxial_getPattern(ctx) { var curMatrix = ctx.mozCurrentTransform; if (curMatrix) { var userMatrix = ctx.mozCurrentTransformInverse; diff --git a/src/util.js b/src/util.js index 63f6115a7..140b18cf1 100644 --- a/src/util.js +++ b/src/util.js @@ -97,7 +97,7 @@ var Util = PDFJS.Util = (function UtilClosure() { return [xt, yt]; }; - Util.applyInverseTransform = function Util_applyTransform(p, m) { + Util.applyInverseTransform = function Util_applyInverseTransform(p, m) { var d = m[0] * m[3] - m[1] * m[2]; var xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; var yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; From 117256ce788cd1c28a9bb39d97e646248624466a Mon Sep 17 00:00:00 2001 From: Kalervo Kujala Date: Tue, 1 May 2012 20:54:16 +0300 Subject: [PATCH 4/4] Correct PDFDocumentProxyClosure name. --- src/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api.js b/src/api.js index 32c49c363..bbab680ce 100644 --- a/src/api.js +++ b/src/api.js @@ -45,7 +45,7 @@ PDFJS.getDocument = function getDocument(source) { * Proxy to a PDFDocument in the worker thread. Also, contains commonly used * properties that can be read synchronously. */ -var PDFDocumentProxy = (function() { +var PDFDocumentProxy = (function PDFDocumentProxyClosure() { function PDFDocumentProxy(pdfInfo, transport) { this.pdfInfo = pdfInfo; this.transport = transport;