Commit Graph

28 Commits

Author SHA1 Message Date
Tim van der Meij
ee48522a86 Merge pull request #4109 from Snuffleupagus/css-zoom-annotations
Update the annotationLayer when using CSS only zoom
2014-01-13 12:14:12 -08:00
Jonas Jenwald
3c637b7ca9 Update the annotationLayer when using CSS only zoom 2014-01-12 23:07:56 +01:00
Jonas Jenwald
05c331c295 Maintain the current position in the document when zooming 2014-01-11 13:01:25 +01:00
Yury Delendik
2f4246abe4 Fixes FitV scrolling 2014-01-10 12:15:09 -06:00
Yury Delendik
5bf3e44e30 Introduces LegacyPromise; polyfills DOM Promise 2014-01-03 18:17:05 -06:00
Brendan Dahl
1bbf0e55b0 Fix rotation regression from #3970. 2013-11-25 14:08:28 -08:00
Brendan Dahl
c20476bfca Fix page rotation for unloaded pages. 2013-11-25 10:05:23 -08:00
Yury Delendik
fdd5d414ed Fixes find position in HiDPI displays 2013-11-25 09:07:10 -06:00
Jonas Jenwald
7542d50167 Fix issues with /FitR destinations 2013-11-23 18:27:03 +01:00
Yury Delendik
bd7985a83b Fixes cleaning up of the rendered pages 2013-11-19 17:08:36 -06:00
Yury Delendik
e712c4136a Cleaning up fonts when viewer is idle for some time 2013-11-18 13:01:54 -06:00
Brendan Dahl
a64cd42de9 Use page promise for text extraction. 2013-11-14 10:26:27 -08:00
Jonas Jenwald
1cae737d03 Fix zoom parameter regression 2013-10-30 14:28:59 +01:00
Jonas Jenwald
f35e777d81 Apply the current zoom level value to each page in Presentation Mode 2013-10-19 18:33:36 +02: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
1f4d85db37 Inline setScale in parseScale 2013-10-16 00:26:42 +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
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
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
df249da923 Use css to initially scale on zoom. 2013-10-02 09:05:46 -07:00
Jonas Jenwald
87eb2dccbe Fix external links in Presentation Mode (issue #3755) 2013-10-02 16:17:38 +02:00
Jonas Jenwald
bfc66626a0 Move Presentation Mode related code from viewer.js to its own file 2013-10-01 23:11:46 +02:00
Brendan Dahl
6ef44da10b Use canvas and css width/height instead of css transform for high dpi. 2013-09-20 12:11:14 -07:00
Jonas Jenwald
2cf2eb0dfc Fix coding style in page_view.js 2013-09-20 09:28:03 +02:00
Jonas Jenwald
cebf3c60e2 Move PageView from viewer.js to its own file 2013-09-20 09:25:41 +02:00