Commit Graph

56 Commits

Author SHA1 Message Date
Yury Delendik
fbd7eedce8 Removes PresentationMode dependency from PDFViewer 2014-09-21 12:47:26 -05:00
Yury Delendik
a06a974f78 Moves rendering queue logic from PDFView 2014-09-21 12:47:26 -05:00
Yury Delendik
7642c39734 Moves pdfDocument.getPage/getTextContent requests out of PDFView 2014-09-21 12:47:26 -05:00
Yury Delendik
7af8748151 Moves viewer code into PDFViewer and some code from PageView. 2014-09-21 12:47:07 -05:00
Mitar
2f72ac1255 textLayer is not used anymore in render context.
It should be removed to prevent confusion when reading the code.
2014-09-19 15:13:01 -07:00
Yury Delendik
e8af56ffc5 Fixes text-selection example 2014-08-06 10:09:27 -05:00
Tim van der Meij
dbe22475e1 Converting PDFFindBar and PDFFindController to classes 2014-07-29 21:59:01 +02:00
Yury Delendik
c1c950ce74 Fixes AnnotationUtils in the extension build 2014-06-18 16:42:08 -05:00
Yury Delendik
bdeca30fbf Splits shared/annotation.js into core/ and display/ 2014-06-17 17:43:33 -05:00
Yury Delendik
0cd28ebfa3 Telemetry for used stream and font types 2014-06-16 16:41:04 -05:00
Yury Delendik
2efbdfe8d4 Merge pull request #4834 from dferer/canvas-max-size
Limit the size of canvases to 5MP (iOS restriction)
2014-06-13 09:37:42 -05:00
Nicholas Nethercote
29d3db4422 Cache pages at the start of drawing, not the end. 2014-06-12 22:54:37 -07:00
Samuel Chantaraud
952545e20f Limit the size of canvases to 5MP (iOS restriction) 2014-06-12 17:58:58 -04:00
Nicholas Nethercote
97cc06a7f9 Zero the height and width of the PageView canvas before deleting. 2014-06-12 16:33:30 +10:00
Mohammed Abu-alsaad
e6546642db Added more preference variables from the available hash parameters 2014-05-30 10:44:41 +12:00
Yury Delendik
97782cafa4 Update text layer correctly when zooming with USE_ONLY_CSS_ZOOM 2014-05-14 09:47:58 -05:00
Samuel Chantaraud
7a4543e348 Prevent the annotationLayer to be recreated when the page is redrawn
This allows interactive annotations to keep their states after a resize
2014-04-16 08:13:54 -04:00
Rob Wu
d7dfa447cd Remove unused (local) variables in web/ 2014-04-15 17:10:23 +02:00
Yury Delendik
f6c631bc31 Reverts #4556 due to flicker on Chome 2014-04-11 14:07:36 -05:00
Yury Delendik
2c61f60a4e Merge pull request #4577 from timvandermeij/reporter
Removes custom test/reporter.js from the lint process
2014-04-10 19:17:48 -05:00
Tim van der Meij
a71a87a821 Fixes lint warning W018: confusing use of exclamation mark 2014-04-11 00:02:31 +02:00
p01
b10aa18b3e Use Opaque Canvas where possible 2014-04-10 11:50:20 +02:00
Brendan Dahl
5bd8a83c9b Build the text layer geometry on the worker. 2014-04-09 16:44:07 -07:00
Samuel Chantaraud
076b3433b4 Improved annotations' display/behavior.
Added an "InteractiveAnnotation" class to homogenize the annotations' structure (highlighting) and user interactions (for now, used for text and link annotations).

Text annotations:
The appearance (AP) has priority over the icon (Name).
The popup extends horizontally (up to a limit) as well as vertically.
Reduced the title's font size.
The annotation's color (C) is used to color the popup's background.
On top of the mouseover show/hide behavior, a click on the icon will lock the annotation open (for mobile purposes). It can be closed with another click on either the icon or the popup.

An annotation printing is conditioned by its "print" bit
Unsupported annotations are not displayed at all.
2014-03-07 10:48:42 -04:00
Brendan Dahl
ce9e9e6ff7 Remove embeddedFontsUsed from API. 2014-02-27 14:06:03 -08:00
Jonas Jenwald
d6ca563f46 Fix wrong page being displayed when entering/exiting Presentation mode with zoom set to 'page-fit' 2014-02-11 22:51:14 +01:00
Brendan Dahl
a340336269 Merge pull request #4081 from yurydelendik/doubledraw
Avoiding double draw() calls
2014-01-14 14:33:16 -08:00
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
378c49c2d8 Avoiding double draw() calls 2014-01-07 10:59:54 -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