diff --git a/Setup-PDF.js-in-a-website-(Windows).mediawiki b/Setup-PDF.js-in-a-website-(Windows).mediawiki deleted file mode 100644 index fd86983..0000000 --- a/Setup-PDF.js-in-a-website-(Windows).mediawiki +++ /dev/null @@ -1,76 +0,0 @@ -== Setup the testing environment == - -The easiest way to setup your testing environment is to follow the instructions posted [https://github.com/mozilla/pdf.js/wiki/Setting-up-pdf.js-Development-Environment-for-Windows here]. You will need Git, the Mozilla build environment and Node.js if you choose the recommended MSYS environment. After that, execute the following commands in Git Bash: - - cd / - git clone git://github.com/mozilla/pdf.js.git - -=== Start the test server === - - cd pdf.js/ - node make server - -If Node.js complains about not recognizing python2.7 as an internal or external command ([https://github.com/mozilla/pdf.js/issues/2016#issuecomment-8008140 more information here]), then go to your Python installation directory (in my case, C:\Python27), copy the file python.exe and rename the copy to python2.7.exe. After that, run the command again. - -Then you can reach your Node.js server using the following URL: - - http://localhost:8888/web/viewer.html - -You can test your own documents by opening them with the Open File button in the toolbar or by placing your PDF file in /web and using a URL such as: - - http://localhost:8888/?file=your-test-file.pdf - -=== Opening PDF files from your website === - -You need to use the file parameter in the URL whose value is a full [https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent encoded URI]. For example: - - http://mozilla.github.com/pdf.js/web/viewer.html?file=http%3A%2F%2Fasync5.org%2Fmoz%2Fpdfjs.pdf - -== Compile PDF.js == - -=== Build === -You need to run this command: - - node make generic - -and you should get the following output (or something similar): - - ### Getting extension build number - Extension build number: 331 - - ### Bundling files into build/pdf.js - - ### Building localization files - - ### Creating generic viewer - -=== Compressing PDF.js (unsupported!) === - -'''Minification is NOT supported''' by the developers of the project. First start testing with the full build and then use the minified version. From my test, the '''minified version did NOT''' work while the normal version did. - -You can minify PDF.js by approximately 30% with [http://yui.github.com/yuicompressor yui-compressor] or other [http://stackoverflow.com/questions/28932/best-javascript-compressor minification tools]. - -==== Use the minified file ==== - -'''Minification might break the libs''' using yui-compressor. Use at your own risk. - -Be sure to edit viewer.html and viewer.js to use the correct file. In this case, we want to use the minified version: - - # viewer.html - - - # viewer.js - PDFJS.workerSrc = './pdf-min.js'; - -== From build to production == - -Now that your build is done, you can copy the viewer and its resources (core files) to your production directory and upload the contents of that directory to your web server (use Git Bash again): - - # make a production directory if you haven't done so already - mkdir production - # copy the viewer and its resources to the production folder - cp -R build/generic production - -=== Compatibility === - -Note that you must include compatibility.js in order to support browsers like IE9+. \ No newline at end of file