Commit Graph

5629 Commits

Author SHA1 Message Date
Adolfo Jayme Barrientos
1b0842ad7c Update viewer.properties 2013-10-23 00:05:34 -05:00
Tim van der Meij
5beefde2c7 Merge pull request #3829 from Snuffleupagus/issue-3827
Apply the current zoom level value to each page in Presentation Mode
2013-10-20 03:32:54 -07:00
Jonas Jenwald
f35e777d81 Apply the current zoom level value to each page in Presentation Mode 2013-10-19 18:33:36 +02:00
Tim van der Meij
fa03a777b6 Merge pull request #3824 from Snuffleupagus/tweak-SecondaryToolbar
A few small tweaks of the SecondaryToolbar code
2013-10-18 14:34:28 -07:00
Jonas Jenwald
bee1b734c2 A few small tweaks of the SecondaryToolbar code 2013-10-18 23:03:28 +02:00
Tim van der Meij
26fb376b65 Merge pull request #3820 from Snuffleupagus/prevent-enter-PresentationMode-during-load
Disable Presentation Mode until the document has started rendering
2013-10-18 11:05:45 -07:00
Yury Delendik
b16b3be5c3 Merge pull request #3791 from brendandahl/css-rotate
Fix css rotation for canvas and text layer.
2013-10-17 17:59:39 -07:00
Jonas Jenwald
d750e4c5e8 Merge pull request #3821 from timvandermeij/secondary-toolbar-elements
Decrease dependence of SecondaryToolbar on UI buttons
2013-10-17 14:56:48 -07:00
Tim van der Meij
46d74bdc51 Decrease dependence of SecondaryToolbar on UI buttons 2013-10-17 23:49:30 +02:00
Tim van der Meij
1c9fc5d7bb Merge pull request #3822 from Snuffleupagus/fix-chromium-PR-bot-breakage
Fix bot breakage caused by Chromium extension PR
2013-10-17 14:24:11 -07:00
Brendan Dahl
ca1806025c Merge pull request #3794 from brendandahl/b2g-fix
Fix the B2G viewer and enable bot preview.
2013-10-17 14:14:17 -07:00
Jonas Jenwald
8405d16379 Fix bot breakage caused by Chromium extension PR 2013-10-17 22:55:25 +02:00
Tim van der Meij
5726ffdcbc Merge pull request #3751 from Rob--W/crx-alternative-loader
[Chrome extension] Change PDF rendering method.
2013-10-17 10:01:37 -07:00
Jonas Jenwald
e367f49686 Disable Presentation Mode until the document has started rendering 2013-10-17 16:52:36 +02:00
Rob Wu
83b780af81 [CRX] Show nicely formatted URL in omnibox
Before commit:
chrome-extension://EXTENSIONID/content/web/viewer.html?file=http%3A%2F%2Fexample.com%2Ffile.pdf

After commit:
chrome-extension://EXTENSIONID/http://example/file.pdf

Technical details:
- The extension's background page uses the webRequest API to intercept
  requests for <extension host>/<real path to pdf>, and redirect it to
  the viewer's URL.
- viewer.js uses history.replaceState to rewrite the URL, so that it's
  easier for users to recognize and copy-paste URLs.
- The fake paths /http:, /https:, /file:, etc. have been added to the
  web_accessible_resources section of the manifest file, in order to
  avoid seeing chrome-extension://invalid/ instead of the actual URL
  when using history back/forward to navigate from/to the PDF viewer.
- Since the relative path resolving doesn't work because relative URLs
  are inaccurate, a <base> tag has been added. This method has already
  been proven to work in the Firefox add-on.

Notes:
- This commit has been cherry-picked from crx-using-streams-api.
- Need to merge https://github.com/mozilla/pdf.js/pull/3582 to deal with
  a bug in Chrome <=30
- In Chrome, getting the contents of a FTP file is not possible, so
  there's no support for FTP files, even though the extension router
  recognizes the ftp: scheme.
2013-10-16 23:14:46 +02:00
Rob Wu
e9cb91de39 [CRX] split:incognito is used, so update file:-handler
The current stable Chromium version is 29. Since the critical
bug that prevented use of incognito:split has been fixed, and
incognito:split is actually used, it's safe to drop the code
that disables the extension in incognito mode.

( fixed bug = http:/crbug.com/224094 )
2013-10-16 23:14:43 +02:00
Rob Wu
edd4bae903 [CRX] Change Viewer insertion method
And use split incognito mode

Previous method:
- Rewrite content type to XHTML, followed by a content script
  to cancel and replace the document with the viewer.
  ( https://github.com/mozilla/pdf.js/pull/3017 )

New method:
- Cancel loading of the document, followed by a redirect to the viewer

Disadvantage of new method:
- URLs are no longer "nice". This will be addressed by cherry-picking
  a commit from the crx-using-streams-api branch.

Advantages of new method:
- Idle time is minimal. In some cases (with large documents),
  it took too much time before the content script was activated.
  During this period, the page looked blank, and the contents of
  the PDF file were still retrieved and **discarded**.
  With the new method, the idle time is minimal, because the request
  is immediately cancelled.
- No FOUXEP (Flash of unhidden XML error page), because the XHTML
  Content-Type hack is no longer used.
2013-10-16 23:14:16 +02:00
Brendan Dahl
d86c7e3ebf Merge pull request #3577 from kkujala/calgray
Implement initial CalGray support
2013-10-16 14:00:41 -07:00
Brendan Dahl
29269748c3 Merge pull request #3554 from fkaelberer/FasterJPXdecoding
Speed up JPX decoding on Firefox
2013-10-16 11:37:47 -07:00
Tim van der Meij
54acf20882 Merge pull request #3810 from timvandermeij/nit-fixes
Minor nit fixes for api.js
2013-10-16 03:08:37 -07:00
Tim van der Meij
4fe1e41c35 Minor nit fixes for api.js 2013-10-16 12:07:27 +02:00
Tim van der Meij
33a9696518 Merge pull request #3796 from brendandahl/global-docs
Add missing jsdocs for PDFJS globals.
2013-10-16 03:04:03 -07:00
Tim van der Meij
2726a0be96 Merge pull request #3787 from Snuffleupagus/inline-setScale
Inline setScale in parseScale
2013-10-16 02:18:02 -07:00
fkaelberer
f6841d1720 extract code to own method for faster JPX decoding 2013-10-16 09:47:03 +02:00
Jonas Jenwald
1f4d85db37 Inline setScale in parseScale 2013-10-16 00:26:42 +02:00
Brendan Dahl
7ebec6c5a4 Add missing jsdocs for PDFJS globals. 2013-10-15 13:41:49 -07:00
Tim van der Meij
7ad19c3355 Merge pull request #3807 from Rob--W/crx-chromium-25
chrome.runtime -> chrome.extension when needed (support Chromium 20-25)
2013-10-14 14:00:33 -07:00
Rob Wu
820b95416b chrome.runtime -> chrome.extension when needed
Some Ubuntu users are still stuck at Chromium 25.
2013-10-14 17:52:49 +02:00
Jonas Jenwald
d153341927 Merge pull request #3801 from Rob--W/hotfix/crx-ubuntu
chrome.extension -> chrome.runtime for Ubuntu
2013-10-13 13:27:28 -07:00
Kalervo Kujala
a5bf02573d Implement initial CalGray support
Gamma and Whitepoint are supported in this patch for CalGray.
Blackpoint is not supported.
2013-10-13 19:55:42 +03:00
Rob Wu
6070a37788 chrome.extension -> chrome.runtime for Ubuntu
Addresses issue #3800, where a bug specific to Ubuntu builds of Chromium
break PDF.js
https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1232575
2013-10-13 12:23:31 +02:00
Tim van der Meij
b9bceb4c4b Merge pull request #3764 from saebekassebil/fingerprint
Simplify get fingerprint() method
2013-10-11 11:55:37 -07:00
Brendan Dahl
702ae3b5e8 Merge pull request #3777 from Snuffleupagus/webkitHideCursor-PresentationMode
Fix hiding of the cursor in Presentation Mode in WebKit browsers
2013-10-11 09:19:12 -07:00
Brendan Dahl
c79acf5861 Fix the B2G viewer and enable bot preview. 2013-10-09 15:04:58 -07:00
Brendan Dahl
99e45048cf Merge pull request #3776 from timvandermeij/thumbnail-jump
Refactoring thumbnail scroll code to fix jumps
2013-10-09 12:41:15 -07:00
Tim van der Meij
b1b661a274 Refactoring thumbnail scroll code to fix jumps 2013-10-09 20:40:21 +02:00
Brendan Dahl
f1a6e9015f Fix css rotation for canvas and text layer. 2013-10-09 11:29:05 -07:00
Tim van der Meij
cdcc26eedf Merge pull request #3790 from timvandermeij/typo-fix
Trivial typo fix
2013-10-09 11:26:10 -07:00
Tim van der Meij
ec7064ea74 Trivial typo fix 2013-10-09 20:24:12 +02:00
Brendan Dahl
6f61a9c83e Merge pull request #3727 from brendandahl/css-zoom2
Use css to initially scale on zoom.
2013-10-08 20:34:22 -07:00
Brendan Dahl
52e429550c Simplify the output scale for css zoom. 2013-10-08 20:31:49 -07:00
Jonas Jenwald
631333c486 Fix hiding of the cursor in Presentation Mode in WebKit browsers 2013-10-08 20:42:35 +02:00
Tim van der Meij
64757dd481 Merge pull request #3774 from Snuffleupagus/contextMenu-PresentationMode
Enabling clicking to close the context menu in Presentation Mode, without going to the next page
2013-10-08 11:31:02 -07:00
Brendan Dahl
9db1e437b0 Merge pull request #3670 from Rob--W/mozPrintCallback-polyfill
Polyfill for mozPrintCallback
2013-10-08 11:18:58 -07:00
Jonas Jenwald
dfb8e62079 Enabling clicking to close the context menu in Presentation Mode, without going to the next page 2013-10-08 20:11:04 +02:00
Rob Wu
194a734e5d Resolved severe memory leak (mozPrintCallback)
Do NOT save the temporary <canvas> element as `this.canvas`.
`PDFViewer.pages[i].canvas` appears to be used to generate the thumbnail
icons. Well, that's no justification for preventing GC of those
temporary <canvas> elements used during mozPrintCallback.

With a document consisting of 79 pages, this resulted in a 600-700MB
leaked memory.
2013-10-08 19:50:45 +02:00
Rob Wu
1731c0fb42 Add mozPrintCallback shim
This shim does the following:
1. Intercept window.print()
2. For a window.print() call (if allowed, ie. no previous print job):
   1. Dispatch the beforeprint event.
   2. Render a printg progress dialog.
   3. For each canvas, call mozPrintCallback if existent (one at a time, async).
   4. During each mozPrintCallback callback, update the progress dialog.
   5. When all <canvas>es have been rendered, invoke the real window.print().
   6. Dispatch the afterprint event.

The shim is not included in Firefox through the preprocessor.

Keyboard shortcuts (Ctrl/Cmd + P) are intercepted and default behavior
(i.e. printing) is prevented, and the steps for window.print() are run.
window.attachEvent is used, in order to cancel printing in IE10 and
earlier (courtesy of Stack Overflow - http://stackoverflow.com/a/15302847).
Unfortunately, this doesn't work in IE11 - if Ctrl + P is used, the
print dialog will be shown twice: Once because of Ctrl + P, and again
when all pages have finished rendering.

This logic of this polyfill is not specific to PDF.js, so it can also
be used in other projects.

There's one additional modification in PDF.js's viewer.js: The printed
<canvas> element is wrapped in a <div>. This is needed, because Chrome
would otherwise print one canvas on two pages.
2013-10-08 19:46:59 +02:00
Brendan Dahl
6d1533293e Merge pull request #3416 from peerlibrary/noHTMLElement
instanceof HTMLElement does not work in jsdom node.js module.
2013-10-08 10:15:00 -07:00
Jonas Jenwald
3ee730d009 Merge pull request #3779 from xavier114fch/zh-TW
Update zh-TW locale
2013-10-07 08:03:15 -07:00
Jonas Jenwald
bfa248c811 Merge pull request #3778 from Haebaru/master
Update ja locale
2013-10-07 07:58:31 -07:00