Commit Graph

277 Commits

Author SHA1 Message Date
Jonas Jenwald
dbc611ac9d Ensure that the textLayer has the same dimensions as the canvasWrapper (issue 6596)
This is a quick fix to get `scrollIntoView` working again for search results, but we really ought to re-write that function since it seems way too brittle.

Fixes 6596.
2015-11-06 12:43:22 +01:00
Yury Delendik
7cb32759ed Better CSS scaling for deviceRixelRatio != 1. 2015-10-28 17:27:42 -05:00
Yury Delendik
5135aa9bec Adds deprecation warning for the API calls. 2015-10-23 09:06:32 -05:00
Yury Delendik
59c13b32aa Adds destroy method to the document loading task.
Also renames PDFPageProxy.destroy method to cleanup.
2015-10-23 08:57:14 -05:00
Tim van der Meij
e28ad20d15 Merge pull request #6475 from Snuffleupagus/PDFPageView-annotationLayer-div
Tweak `PDFPageView` to reflect that `this.annotationLayer` is an `AnnotationsLayerBuilder` instance, instead of a DOM element (PR 5552 follow-up)
2015-09-29 23:38:04 +02:00
Jonas Jenwald
5e7ce9d62d Fix incorrect indentation, and remove else after return, in PDFPageView_update 2015-09-26 15:41:02 +02:00
Jonas Jenwald
1ae9ba1d64 Don't clear the canvas until re-rendering is finished when the scale or rotation is changed (issue 6467)
*This regressed in PR 4920.*

The main motivation for PR 4920 was to quickly get rid of old canvases when pages are evicted from the `PDFPageViewBuffer` cache. However it inadvertently broke the use-case where the `canvas` is used as a preview, on scale or rotation changes, until the re-rendering is finished.

Fixes 6467.
2015-09-26 15:40:59 +02:00
Jonas Jenwald
c7fd7f898f Tweak PDFPageView to reflect that this.annotationLayer is an AnnotationsLayerBuilder instance, instead of a DOM element (PR 5552 follow-up)
In PR 5552, specifically commit 9f384bbb41, the meaning of `this.annotationLayer` changed in `PDFPageView`. Previously it referred directly to a DOM element, but now it's instead an instance of `AnnotationsLayerBuilder`.
This patch tweaks things so that we won't try to hide a non-existent `annotationLayer` div in `PDFPageView_reset`, and also so that we don't attempt to insert empty (`null`) DOM elements in `PDFPageView_draw`.
2015-09-24 12:24:47 +02:00
Tim van der Meij
d7aa95d6b1 Merge pull request #5857 from Rob--W/print-page-size
Set page size via @page + size
2015-05-14 16:52:40 +02:00
Tim van der Meij
6159da0598 Merge pull request #5828 from Rob--W/mozCurrentTransform-fix
Fix flaw in mozCurrentTransform polyfill
2015-04-29 19:27:02 +02:00
Mohamed Baig
6d8adb31ad Added the data-page-number dom attribute to the page rendered in the browser
Added data-page-id attribute to page container divs

Updated the attribute with a better label
2015-03-27 18:23:39 -04:00
Rob Wu
d34e6ddd60 Set page size via @page + size
In Blink-based browsers, there is a mismatch between document size and
paper size. Even if exactly the same values and unit are used, it is
possible that the printed results takes more pages than expected.

To solve the issue, the page size is set via @page size, and the canvas
and ancestor nodes are assigned a width+height of 100% (=relative to the
page). This change resolves bugs such as blank pages and split pages.
2015-03-23 11:19:48 +01:00
Rob Wu
6eb9e6a6a4 Fix flaw in mozCurrentTransform polyfill
Set transformation matrix in (polyfilled) mozPrintCallback when a scale
is applied. Removed _scaleX and _scaleY in favor of _transformMatrix to
emphasize that the caller MUST ensure that the state of the matrix is
correct before `addContextCurrentTransform` is called.
2015-03-11 20:55:26 +01:00
Jonas Jenwald
eed67ea8bb Remove the |el| property in PDFPageView and PDFThumbnailView 2015-02-27 00:26:02 +01:00
Jonas Jenwald
8471bb3206 Avoid getting |childNodes| twice in PDFPageView_reset, by using the variable instead 2015-01-26 12:22:09 +01:00
Tim van der Meij
dd7fd0b665 Merge pull request #5588 from Snuffleupagus/remove-pageView-anchor
Remove unused anchor links placed before every page
2015-01-23 22:38:09 +01:00
Jonas Jenwald
95dd9ee185 Move the |pagerendered| event to pdf_page_view.js
Also deprecates the |pagerender| event, except for GENERIC builds.
2015-01-06 21:44:22 +01:00
Jonas Jenwald
42a00394b0 Remove unused anchor links placed before every page
In old versions of the viewer, anchor links were used to be able to scroll a page into view. Since we for quite some time have had a `scrollIntoView` function which handles this, the anchor links are no longer necessary and I believe that they can be removed. Doing so will reduce the total number of DOM elements in the viewer.

For most documents this patch will probably not make much of a difference performance wise, but for very long (1000+ pages) documents this could help performance especially on lower powered hardware.
2015-01-05 20:42:56 +01:00
Yury Delendik
2565e627a3 Refactors draw method in PDFPageView; makes optional some PDFPageViewOptions options 2014-12-20 23:41:34 -06:00
Yury Delendik
2ac7ac4678 Removes lastScrollSource and isViewerInPresentationMode from TextLayerBuilderOptions 2014-12-20 11:14:13 -06:00
Yury Delendik
b930228788 Refactors Cache into PDFPageViewBuffer 2014-12-19 16:54:32 -06:00
Yury Delendik
22c62685b0 Removes Stats dependency from PDFPageView. 2014-12-19 13:07:28 -06:00
Yury Delendik
9f384bbb41 Creates AnnotationsLayerBuilder. 2014-12-19 13:07:28 -06:00
Yury Delendik
fe4ac86781 Removes PDFPageSource 2014-12-19 09:55:11 -06:00
Yury Delendik
7663942ee5 Creates IPDFTextLayerFactory interface 2014-12-17 15:21:54 -06:00
Yury Delendik
f68678086d Simple restructuring PageView into PDFPageView 2014-12-17 15:21:54 -06:00
Yury Delendik
863d583ae1 Renames page_view.js file. 2014-12-17 10:32:07 -06:00