Yury Delendik
1d12aed5ca
Move all PDFJS.xxx settings into display/global.
2016-04-07 13:46:07 -05:00
Yury Delendik
055d642bf2
Merge pull request #7107 from Rob--W/worker-loading
...
Detect premature worker load error
2016-04-02 10:40:26 -05:00
Rob Wu
c8996f654f
Detect and handle premature worker load error
...
Fall back to a fake worker if the worker fails to load or initialize,
e.g. due to a network error, a security error or simply a script error.
2016-04-02 11:06:15 +02:00
Brendan Dahl
4e2f70440f
Merge pull request #6711 from yurydelendik/errors
...
Better errors capturing at the core and stop rendering on error.
2016-03-29 09:19:28 -07:00
Yury Delendik
2fa4dd6f40
Proxy global PDFJS.verbosity to properly configure shared/util.
2016-03-23 19:24:37 -05:00
Yury Delendik
a8e5912cb1
Moves shared/global to display/global
2016-03-23 19:24:37 -05:00
Yury Delendik
e372f3608b
Makes WorkerMessageHandler non-global.
2016-03-23 19:24:37 -05:00
Yury Delendik
bda5e6235e
Removes global PDFJS usage from the src/core/.
2016-03-23 19:24:37 -05:00
Jonas Jenwald
91756f6e86
Pass the PDFJS.postMessageTransfer
parameter to the worker, so that the MessageHandler
can be setup correctly in createDocumentHandler
(issue 6957)
...
This regressed in commit acdd49f480
, i.e. PR 6571.
Fixes 6957.
2016-03-16 18:34:26 +01:00
Yury Delendik
8ba413e761
Better errors capturing at the core and stop rendering on error.
2016-03-11 07:59:09 -06:00
Jonas Jenwald
7cf9de2c17
[api-minor] Change getOutline
to actually return the RGB color of outline items
...
Currently the `C` entry in an outline item is returned as is, which is neither particularly useful nor what the API documentation claims.
This patch also adds unit-tests for both the color handling, and the `F` entry (bold/italic flags).
2016-02-15 13:41:22 +01:00
Prayag Verma
049beac346
Fix a typo in api.js
...
`fulfills` misspelt as `fullfills`
2016-02-11 07:18:56 +05:30
Brendan Dahl
d7e5935f91
Merge pull request #6938 from yurydelendik/fix-ff-disableworker
...
Fix 'Ready' message sequence for Firefox ext disabled worker.
2016-02-09 10:50:12 -08:00
Tim van der Meij
a0aa781c39
Merge pull request #6913 from Rob--W/importScripts-work-around
...
Improve work-around for importScripts bug.
2016-02-04 19:51:26 +01:00
Rob Wu
097e273ca4
Improve work-around for importScripts bug.
...
Reverts "Hack to avoid intermidiate Chrome failures during tests."
(2b2c521213
).
require.js uses importScript asynchronously, which activates the worker
GC bug in WebKit. This patch works around a bug in a way that is similar
in the upcoming (but not yet released) require.js 2.1.23
The advantage of the new work-around is that it allows the runtime to
garbage-collect idle Workers.
References:
- https://crbug.com/572225
- https://webkit.org/b/153317
2016-02-03 23:30:27 +01:00
Yury Delendik
e36b04e1ff
Fix 'Ready' message sequence for Firefox ext disabled worker.
2016-01-29 11:43:19 -06:00
Jonas Jenwald
e401804f13
Remove the 'oplist' rendering intent when getOperatorList
has returned the complete OperatorList
, and prevent errors in PDFPageProxy_destroy
for the 'oplist' rendering intent
2016-01-29 12:34:26 +01:00
Yury Delendik
825a2225ab
Merge pull request #6915 from yurydelendik/lookuptables
...
Refactor lookup hash tables/objects
2016-01-28 15:01:06 -06:00
Yury Delendik
2edf2792dc
Replaces literal {} created lookup tables with Object.create
2016-01-28 12:18:38 -06:00
Brendan Dahl
252b9d5910
Merge pull request #6753 from yurydelendik/cdn-worker
...
Wraps worker script if its cross-origin location is detected.
2016-01-27 13:21:10 -08:00
Jonas Jenwald
1140a34f5c
[api-minor] Change getPageLabels
to always return the pageLabels, even if they are identical to standard page numbering
2016-01-27 13:36:03 +01:00
Jonas Jenwald
85cf90643f
[api-minor] Add support for PageLabels in the API
2016-01-19 22:49:04 +01:00
Jonas Jenwald
0030a82dc3
[api-minor] Add support for URLs in the document outline
...
Re: issue 5089.
(Note that since there are other outline features that we currently don't support, e.g. bold/italic text and custom colours, I thus think we can keep the referenced issue open.)
2016-01-19 21:36:27 +01:00
Yury Delendik
1e45f2d4e1
Wraps worker script if its cross-origin location is detected.
2016-01-15 15:05:46 -06:00
Yury Delendik
f340dd5cd5
Adds pdfjs/main_loader module to better mirror pdfjs-dist/build/pdf.
2015-12-30 13:28:57 -06:00
Yury Delendik
cbbb9bb82d
Adds UMD header to pdf.js and pdf.worker.js files.
2015-12-29 18:15:14 -06:00
Yury Delendik
2b2c521213
Hack to avoid intermidiate Chrome failures during tests.
...
Remove when https://code.google.com/p/chromium/issues/detail?id=572225 is fixed.
2015-12-29 09:20:53 -06:00
Yury Delendik
fc3282db56
Adds RequireJS to worker.
2015-12-29 09:20:52 -06:00
Yury Delendik
79c2f69c32
Adds/modifies examples for node.js and webpack.
2015-12-21 13:46:50 -06:00
Tony Jin
11f3deac56
Allow link rel to be customized. Defaults to 'noreferrer'
2015-12-17 10:36:53 -08:00
Yury Delendik
b084dc09ee
Allows requirejs and node load fake worker files.
2015-12-15 13:24:39 -06:00
Yury Delendik
6b60c8f4db
Adds UMD headers to core, display and shared files.
2015-12-15 13:24:39 -06:00
Yury Delendik
c9cb6a3025
Replaces UnsupportedManager with callback.
2015-11-30 14:42:47 -06:00
Yury Delendik
8dff301ce1
Worker shall wait for MessageHandler to be created at api side.
2015-11-25 18:21:23 -06:00
Jonas Jenwald
6dfe53b976
[api-minor] Add a parameter to PDFPageProxy_getTextContent
that enables replacing of all whitespace with standard spaces in the textLayer (issue 6612)
...
This patch goes a bit further than issue 6612 requires, and replaces all kinds of whitespace with standard spaces.
When testing this locally, it actually seemed to slightly improve two existing test-cases (`tracemonkey-text` and `taro-text`).
Fixes 6612.
2015-11-25 17:28:40 +01:00
Tim van der Meij
c2dfe9e9a9
Merge pull request #6571 from yurydelendik/worker
...
[api-minor] Allows a worker to handle multiple documents.
2015-11-24 22:42:44 +01:00
Tim van der Meij
c280fb516d
Merge pull request #6679 from Snuffleupagus/better-openExternalLinksInNewWindow-deprecation-comments
...
Improve the comment and deprecation warning for `PDFJS.openExternalLinksInNewWindow`
2015-11-24 22:38:43 +01:00
Yury Delendik
06c1904675
Refactors FontLoader to group fonts per document.
2015-11-24 13:27:22 -06:00
Yury Delendik
09772e1e15
Creates PDFWorker, separates fetchDocument from transport.
2015-11-24 13:27:22 -06:00
Yury Delendik
acdd49f480
Adds peer communication between MessageHandlers.
2015-11-24 12:16:58 -06:00
Jonas Jenwald
27c8e1e22f
Improve the comment and deprecation warning for PDFJS.openExternalLinksInNewWindow
...
This patch:
- Updates the JSDoc comment in `api.js`, to more clearly point out that `PDFJS.openExternalLinksInNewWindow` is deprecated, and explains what to use instead.
- Changes the `warn`, in `isExternalLinkTargetSet()`, to use the new `deprecated` function instead. Also updates the message with more detailed information about what to use instead.
- Changes the pre-processor tag to ensure the deprecation warning is seen in all build types where it could possibly matter (in case people are using `PDFJS.openExternalLinksInNewWindow` in e.g. custom-built extensions).
These changes were prompted by seeing http://stackoverflow.com/questions/33813373/pdf-js-how-to-open-hyperlinks-in-a-new-tab-window , since it seems to me that the current comments/warnings might not be worded well enough.
2015-11-23 13:12:23 +01:00
Jonas Jenwald
b05652ca97
[api-minor] Let getAnnotations
fetch all annotations by default, unless an intent is specified
...
Currently `getAnnotations` will *only* fetch annotations that are either `viewable` or `printable`. This is "hidden" inside the `core.js` file, meaning that API consumers might be confused as to why they are not recieving *all* the annotations present for a page.
I thus think that the API should, by default, return *all* available annotations unless specifically told otherwise. In e.g. the default viewer, we obviously only want to display annotations that are `viewable`, hence this patch adds an `intent` parameter to `getAnnotations` that makes it possible to decide if only `viewable` or `printable` annotations should be fetched.
2015-11-22 15:51:37 +01:00
Yury Delendik
194994a289
Merge pull request #6551 from yurydelendik/subaa
...
[api-minor] Enables subpixel anti-aliasing for most of the content.
2015-11-17 19:45:32 -06:00
Yury Delendik
1d8800370a
Allow subpixel anti-aliasing for most of the content.
2015-11-16 10:50:02 -06:00
Manas
a2ba1b8189
Uses editorconfig to maintain consistent coding styles
...
Removes the following as they unnecessary
/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
2015-11-14 07:32:18 +05:30
Yury Delendik
7381ff9523
Merge pull request #6599 from prometheansacrifice/generate-better-api-docs
...
Generate better API documentation
2015-11-12 14:26:18 -06:00
Manas
dbcb46c8de
Uses @alias to fix missing comments on JSDocs pages
2015-11-13 01:24:15 +05:30
Yury Delendik
601d29b14e
Fixes all examples to require workerSrc to be set.
2015-11-06 07:50:21 -06:00
Brendan Dahl
b56b41514c
Merge pull request #6578 from yurydelendik/issue6577
...
Ignore any pending data when worker is terminated.
2015-10-29 11:49:40 -07:00
Yury Delendik
8d15ecb14b
Ignore any pending data when worker is terminated.
2015-10-29 13:06:22 -05:00
Tony Jin
ef667823dd
[api-minor] Add an optional param to DocumentInitParameters for specifying the range request chunk size to use. Defaults to 2^16 = 65536.
2015-10-26 17:22:11 -07:00
Jonas Jenwald
5bd95df427
Prevent TypeError: page is undefined
when the document has been destroyed (PR 6546 follow-up)
...
*Follow-up to PR 6546.*
If rendering has already started when the document is destroyed, then `this.pageCache[data.pageIndex]` may already have been cleared when the `StartRenderingPage`/`RenderPageChunk` messages are recieved in `api.js`, which results in `TypeError`s being thrown.
2015-10-23 22:16:34 +02:00
Yury Delendik
5135aa9bec
Adds deprecation warning for the API calls.
2015-10-23 09:06:32 -05:00
Yury Delendik
58c3ea0820
Adds thread abort capabilities.
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
Jonas Jenwald
9ab896e307
[api-minor] Add an option to PDFJS for specifying the |target| attribute of external links
...
Replaces `PDFJS.openExternalLinksInNewWindow` with a more generic configuration option.
*Note:* `PDFJS.openExternalLinksInNewWindow = true;` is equal to `PDFJS.externalLinkTarget = PDFJS.LinkTarget.BLANK;`.
2015-10-13 21:52:00 +02:00
Vincent Castelain
0cd4cc4e80
api/getDocument : handle ArrayBuffer check for PDF binary data (byteLength)
2015-08-20 08:56:05 +02:00
Yury Delendik
c56dc9a093
Merge pull request #6141 from skalnik/fix-font-csp-issues
...
Provide a fallback for font rendering when not allowed to use `eval`
2015-08-18 18:50:11 -05:00
Mike Skalnik
341c5e9d1f
[PATCH] Add fallback for font loading when eval disabled
...
In some cases, such as in use with a CSP header, constructing a function with a
string of javascript is not allowed. However, compiling the various commands
that need to be done on the canvas element is faster than interpreting them.
This patch changes the font renderer to instead emit commands that are compiled
by the font loader. If, during compilation, we receive an EvalError, we instead
interpret them.
2015-08-13 14:33:18 -07:00
Tim van der Meij
995c5ba205
Simplify annotation data passing
2015-07-19 14:02:49 +02:00
Yury Delendik
dd07ef9c6a
Disables rAF for the printing.
2015-05-12 08:44:42 -05:00
Jonas Jenwald
65a5543efe
Disable PresentationMode for certain problematic configurations
...
Instead of trying to hack around various browser defects, let's just disable PresentationMode in the affected browsers. This patch:
- Disables PresentationMode in IE11+ when the viewer is embedded; fixes 4711.
2015-03-13 22:09:36 +01:00
Jonas Jenwald
00ee6bd6b6
Merge pull request #5693 from collinanderson/whitespace
...
cleaned whitespace
2015-02-28 10:09:21 +01:00
Mike Lyons
d271811740
Add option to open external links in new window
2015-02-26 13:34:08 -05:00
Collin Anderson
54e984c763
cleaned whitespace
2015-02-17 11:07:37 -05:00
Jonas Jenwald
daba13aebb
Amend the docs for |disableAutoFetch| to mention that streaming must also be disabled
2015-01-14 18:33:12 +01:00
Yury Delendik
81649b00a9
Base64 example and be more flexible what type of data is passed.
2015-01-12 14:52:52 -06:00
Yury Delendik
3a61edfcae
Refactors getDocument and adds PDFDataRangeTransport.
2015-01-05 21:45:01 -06:00
Tim van der Meij
b215af30d3
Require destinations when they are needed and do not fetch all of them in advance
2014-10-06 22:26:18 +02:00
Jonas Jenwald
cb3e5903cb
Fix disableAutoFetch regression in the generic viewer
...
After PR 5263, setting `disableAutoFetch = true` in the generic viewer no longer works correctly, since the entire file loads even with `disableStream = true`.
2014-10-01 20:53:17 +02:00
Rob Wu
6a230af332
Rename FontFace to FontFaceObject
...
This name clashes with the FontFace constructor from the Font Loading CSS module:
http://dev.w3.org/csswg/css-font-loading/#font-face-constructor
2014-09-30 19:33:16 +02:00
Yury Delendik
c3f191a27c
Implement streaming using moz-chunk-arraybuffer
2014-09-19 19:05:25 -05:00
Jonas Jenwald
ed5fc43510
Add |UnexpectedResponseException| to fix the exception handling when file loading fails because the server responds with a non 404 status message
2014-09-14 11:52:33 +02:00
Jonas Jenwald
ca027ebfdb
Fix the exception propagation when rejecting workerReadyCapability
...
Currently when an exception is thrown, we try to reject `workerReadyCapability` with multiple arguments in src/core/api.js. This obviously doesn't work, hence this patch changes that to instead reject with the exception object as is.
In src/core/worker.js the exception is currently (unncessarily) wrapped in an object, so this patch also simplifies that to directly send the exception object instead.
2014-09-08 22:20:41 +02:00
Jonas Jenwald
64d95bedaa
In src/display/api.js, add documentation for the |progressCallback| parameter in |PDFJS.getDocument|
2014-08-28 14:11:14 +02:00
pramodhkp
6d53fc4db7
Minor changes for api.js, font_loader.js and svg.js
2014-08-14 01:01:09 +05:30
Jonas Jenwald
a4b06d7a02
Add strict equalities in src/display/api.js
2014-08-01 12:39:31 +02:00
Yury Delendik
0f0f0688a1
Merge pull request #4946 from Snuffleupagus/issue-3862
...
Refactor fake worker loading (issue 3862)
2014-06-17 13:27:01 -05:00
Yury Delendik
ea16723448
Merge pull request #4951 from pramodhkp/getoperatorlist
...
Added getOperatorList to api.js
2014-06-17 09:39:09 -05:00
pramodhkp
1d00e9d13c
Added getOperatorList to api.js
2014-06-18 01:30:42 +05:30
Yury Delendik
0cd28ebfa3
Telemetry for used stream and font types
2014-06-16 16:41:04 -05:00
Jonas Jenwald
3c78c7b8bc
Refactor fake worker loading (issue 3862)
2014-06-15 15:52:05 +02:00
Samuel Chantaraud
952545e20f
Limit the size of canvases to 5MP (iOS restriction)
2014-06-12 17:58:58 -04:00
Mohammed Abu-alsaad
e6546642db
Added more preference variables from the available hash parameters
2014-05-30 10:44:41 +12:00
Jonas Jenwald
c4d4682924
Fix regression that prevents downloading the PDF file (PR 4752)
2014-05-14 01:20:21 +02:00
Jonas Jenwald
44cd0f4a76
Merge pull request #4752 from yurydelendik/refmsghdlr
...
Refactors MessageHandler.send to remove callbacks
2014-05-13 22:47:04 +02:00
Yury Delendik
2acb40fffb
Merge pull request #4771 from Snuffleupagus/api-promise-reject-fix
...
Fix typo when rejecting Promise in getPage
2014-05-10 07:48:30 -05:00
Tim van der Meij
e359f0694f
Merge pull request #4740 from yurydelendik/pageviewportdoc
...
Adds pageviewport documentation
2014-05-09 22:30:16 +02:00
Yury Delendik
c5eb058b09
Uses rAF to interrupt the operator list execution
2014-05-09 07:00:47 -05:00
Yury Delendik
cc9643cf32
Refactors GetAnnotationsRequest and GetPageRequest
2014-05-08 15:02:53 -05:00
Yury Delendik
2008f74185
Refactors MessageHandler.send to remove callbacks
2014-05-07 18:15:25 -05:00
Jonas Jenwald
652dde48da
Fix typo when rejecting Promise in getPage
2014-05-07 23:25:24 +02:00
Jonas Jenwald
f3f3db0d15
Remove 'info' and 'metadata' from GetDoc
2014-05-07 22:07:11 +02:00
Jonas Jenwald
069f0cc8c0
Remove 'javaScript' from GetDoc
2014-05-07 21:54:15 +02:00
Jonas Jenwald
4bfcb27d0b
Remove 'outline' from GetDoc
2014-05-07 21:16:35 +02:00
Yury Delendik
95e61ad0e3
Adds pageviewport documentation
2014-05-05 14:09:47 -05:00
Yury Delendik
2b82eb0161
Fixes cancel rendering regression
2014-05-01 15:51:38 -05:00
Pramodh KP
0d5b41633f
Remove legacy promises from api.js
2014-05-01 18:13:13 +05:30
Samuel Chantaraud
25ee0e8572
Preliminary attachments support
...
Added a partial Filespec support
Added getAttachments in API
Added a new attachments view in UI (with a new icon by @shorlander)
2014-04-18 12:11:00 -04:00
Yury Delendik
a00f854848
Refactors buildImage to use Promise; don't draw bad images
2014-04-14 15:22:35 -05:00