Commit Graph

9943 Commits

Author SHA1 Message Date
Christian Myksvoll
95093a5276 Check for undefined url (#8640)
* Check for undefined

new URL(file, window.location.href) throws the following error in IE11 + iPad Safari:
Unable to get property 'replace' of undefined or null reference

* Adapting previous change to pdf.js code standards

Added curly braces

* Moved check for undefined above try/catch
2017-07-13 13:48:04 -07:00
Yury Delendik
c673b6fee1 Merge pull request #8646 from yurydelendik/issue-8645
Fixes pdf.js library source detection.
2017-07-13 15:20:17 -05:00
Yury Delendik
52460687ca Fixes pdf.js library source detection. 2017-07-13 14:57:39 -05:00
Jonas Jenwald
a63015a9a2 Merge pull request #8643 from Snuffleupagus/polyfill-Number-isNaN
Add `Number.isNaN` and `Number.isInteger` polyfills in compatibility.js, since the Streams polyfill relies on them
2017-07-13 18:25:46 +02:00
Jonas Jenwald
f2270252c7 Add Number.isNaN and Number.isInteger polyfills in compatibility.js, since the Streams polyfill relies on them
Without this, the Streams polyfill will fail in Internet Explorer when the code-paths containing these methods are used.
2017-07-13 12:02:14 +02:00
Yury Delendik
2cef24a2ad Merge pull request #8630 from Rob--W/issue-8622-remove-__pdfjsdev_webpack__
Remove __pdfjsdev_webpack__, use webpack options
2017-07-10 11:31:45 -05:00
Jonas Jenwald
85161fa6dc Update l10n files 2017-07-10 12:20:25 +02:00
Rob Wu
742ed3d1c9 Remove __pdfjsdev_webpack__, use webpack options
`__pdfjsdev_webpack__` was used to skip evaluating part of an AST,
in order to not mangle some `require` symbols.
This commit removes `__pdfjsdev_webpack__`, and:

- Uses `__non_webpack_require__` when one wants the output to
  contain `require` instead of `__webpack_require__`.
- Adds options to the webpack config to prevent "polyfills" for
  some Node.js-specific APIs to be added.
- Use `// eslint-disable-next-line no-undef` instead of `/* globals ... */`
  for variables that are not meant to be used globally.
2017-07-09 16:35:48 +02:00
Yury Delendik
7b4887dd21 Merge pull request #8581 from yurydelendik/rm-error
Removes error()
2017-07-07 09:43:30 -05:00
Yury Delendik
d028c26210 Removes error() 2017-07-07 09:40:24 -05:00
Jonas Jenwald
ac9802809c Merge pull request #8621 from Rob--W/eslint-version-update
Bump minimum eslint version to 3.19.0
2017-07-06 15:58:06 +02:00
Rob Wu
06887b6b62 Bump minimum eslint version to 3.19.0
The previously referenced eslint version is not compatible with our code base.
For example, rule "prefer-promise-reject-errors" requires 3.14.0.
2017-07-06 15:40:08 +02:00
Jonas Jenwald
12f1b747b1 Merge pull request #8555 from Snuffleupagus/viewer-components-pdfDocument-checks
Don't allow setting various properties, such as `currentPageNumber`/`currentScale`/`currentScaleValue`/`pagesRotation`, before `{PDFViewer, PDFThumbnailViewer}.setDocument` has been called
2017-07-06 06:30:13 +02:00
Jonas Jenwald
1788a6b0cf Merge pull request #8615 from Snuffleupagus/issue-8613
Fix a stupid spelling error in the `ASCII85Decode` name in `Parser.makeInlineImage` (issue 8613)
2017-07-05 22:22:04 +02:00
Jonas Jenwald
ea71d23f74 Fix a stupid spelling error in the ASCII85Decode name in Parser.makeInlineImage (issue 8613)
This is a trivial follow-up to PR 5383, and it's a bit strange that this has been wrong since late 2014 without anyone noticing (maybe because inline images aren't too common).
So, apparently code works better if you actually spell correctly, who knew ;-)

Fixes 8613.
2017-07-05 19:43:09 +02:00
Yury Delendik
b3bac5100c Merge pull request #8596 from mukulmishra18/proper-read-result
Fixes wrong structure of fullReader.read() result.
2017-07-05 09:03:57 -05:00
Jonas Jenwald
eff257b820 Merge pull request #8580 from brendandahl/missing-glyf
Fix how we detect and handle missing glyph data.
2017-07-04 12:16:07 +02:00
Jonas Jenwald
05b1ef2d23 Merge pull request #8594 from Snuffleupagus/es6-web-let
Change `var` to `let`, and use object destructuring, in a couple of previously class converted `web/*.js` files
2017-07-04 11:59:25 +02:00
Brendan Dahl
9f5c1550ed Merge pull request #8592 from brendandahl/cmap-3-0
Only mask char codes of (3, 0) cmap tables in the range of 0xF000 to 0…
2017-07-03 17:58:28 -07:00
Brendan Dahl
efbbd8533f Only mask char codes of (3, 0) cmap tables in the range of 0xF000 to 0xF0FF. 2017-07-03 13:13:46 -07:00
Brendan Dahl
6d4f748fb1 Fix how we detect and handle missing glyph data. 2017-07-03 13:06:06 -07:00
Jonas Jenwald
614e8cf295 Change var to let, and use object destructuring, in a couple of previously class converted web/*.js files
Note that these files were among the first to be converted to ES6 classes, so it probably makes sense to do another pass to bring them inline with the most recent ES6 conversions.
2017-07-03 11:22:49 +02:00
Jonas Jenwald
699f3392e4 Update l10n files 2017-07-03 11:10:21 +02:00
Mukul Mishra
308a83e5ca Fixes wrong structure of fullReader.read() result. 2017-07-01 15:52:47 +05:30
Tim van der Meij
9e4dcf156b Merge pull request #8585 from Snuffleupagus/issue-8584
Check that the `MessageHandler` isn't already terminated in the `onFailure` handler in `src/core/worker.js` (issue 8584)
2017-06-30 23:28:59 +02:00
Jonas Jenwald
82bd62ecc6 Merge pull request #8583 from Snuffleupagus/es6-app
ES6-ify the code in `web/app.js` and `web/viewer.js`
2017-06-30 10:19:09 +02:00
Jonas Jenwald
de0e7a9a68 Check that the MessageHandler isn't already terminated in the onFailure handler in src/core/worker.js (issue 8584)
All other code-paths already checks that the `MessageHandler` isn't terminated, but apparently `onFailure` was missing that check (compare e.g. with the `onSuccess` function).
From what I can tell, this is only an issue if workers are *disabled*, hence why I didn't bother adding a unit-test.

Fixes 8584.
2017-06-30 10:11:13 +02:00
Jonas Jenwald
d64ac95a91 ES6-ify the code in web/app.js and web/viewer.js
The changes consist mostly of changing `var` to `let`/`const`, and using shorthand method signatures.
2017-06-30 10:10:01 +02:00
Jonas Jenwald
80c33253ed Merge pull request #8582 from timvandermeij/es6-text-layer-builder
Convert the text layer builder to ES6 syntax
2017-06-30 10:08:28 +02:00
Tim van der Meij
19f56ec5c1
Convert the text layer builder to ES6 syntax 2017-06-29 23:41:25 +02:00
Jonas Jenwald
87a0031d77 Merge pull request #8589 from brendandahl/fix-expert-encoding
Fix missing notdef in expert encoding.
2017-06-29 22:05:44 +02:00
Brendan Dahl
a8a8909d2d Fix missing notdef in expert encoding. 2017-06-29 12:12:39 -07:00
Tim van der Meij
d6a6f390ae Merge pull request #8578 from Snuffleupagus/es6-ui_utils
ES6-ify the code in `web/ui_utils.js`
2017-06-28 22:24:37 +02:00
Jonas Jenwald
f6369fc87c ES6-ify the code in web/ui_utils.js
These changes consists mainly of replacing `var` with `let`/`const`, adding a couple of default parameters to function signatures, and finally converting `EventBus`/`ProgressBar` to proper classes.
2017-06-28 12:35:12 +02:00
Jonas Jenwald
f2fcf2a59c Merge pull request #8574 from timvandermeij/svg-stroke-properties
SVG: move setting the stroke properties to the `stroke` method
2017-06-27 10:16:30 +02:00
Tim van der Meij
f87f0d6812 Merge pull request #8576 from Snuffleupagus/toolbar-inline-selectScaleOption
Remove the `selectScaleOption` helper function, in `Toolbar._updateUIState`, and simply inline its code instead
2017-06-26 23:28:43 +02:00
Jonas Jenwald
1db290e818 Update l10n files 2017-06-26 14:30:41 +02:00
Jonas Jenwald
d4b93bec96 Remove the selectScaleOption helper function, in Toolbar._updateUIState, and simply inline its code instead
After PR 8510, we now always lookup the localized `page_scale_percent` string to prevent any possible ordering issues. Since the scaleSelect dropdown is updated asynchronous, there's really no point in having a helper function any more, hence this code can rather be placed inline in `Toolbar._updateUIState`.
2017-06-26 13:06:24 +02:00
Tim van der Meij
f1a87bab10
SVG: move setting the stroke properties to the stroke method
In general, we may not know the stroke properties when path construction
happens. Since we must know the properties when we apply the stroke, we
should set the properties at that point. Note that we already do that
for the color and opacity, but not yet for the other properties.
2017-06-25 22:28:46 +02:00
Jonas Jenwald
859e3d4dce Merge pull request #8564 from timvandermeij/svg-opacity
SVG: implement fill and stroke opacity
2017-06-24 22:42:18 +02:00
Tim van der Meij
d3a3b1db13 Merge pull request #8571 from Snuffleupagus/readme-es6
Mention in the "Getting the Code" section of README.md that an ES6 compatible browser is required when using the default viewer with `gulp server`
2017-06-24 22:14:29 +02:00
Jonas Jenwald
84d0df2b31 Mention in the "Getting the Code" section of README.md that an ES6 compatible browser is required when using the default viewer with gulp server
The https://github.com/mozilla/pdf.js/wiki/Contributing article has been updated to explicitly mention that an ES6 browser is now a minimum requirement for development.
Since we recently have seen a couple of issues filed which seemed to indicate that people tried to use PDF.js in browsers without full ES6 support, it's probably a good idea to mention this more prominently in the README as well.
2017-06-24 12:36:20 +02:00
Brendan Dahl
f1f9d98519 Merge pull request #8507 from Snuffleupagus/issue-8480
Only special-case OpenType fonts with `CFF` data if it's both a composite (i.e. Type0) font and also has a non-default CID to GID map (issue 8480)
2017-06-23 13:36:58 -07:00
Yury Delendik
e2ca894fec Merge pull request #8488 from mukulmishra18/streams-getTextContent
Streams get text content
2017-06-23 12:52:13 -05:00
Yury Delendik
d1567a947e Merge pull request #8567 from ghetolay/fix_CMapReaderFactory+worker
Fix error when using custom CMapReaderFactory
2017-06-23 12:49:55 -05:00
ghetolay
7f79e12383 Fix error when using custom CMapReaderFactory and worker 2017-06-23 15:59:43 +02:00
Tim van der Meij
f9eafefa09
SVG: implement stroke opacity 2017-06-23 00:37:27 +02:00
Tim van der Meij
440914e49b
SVG: implement fill opacity
This makes the `eoFill` method similar to the `eoStroke` method and the
ones in `src/display/canvas.js`.
2017-06-23 00:37:27 +02:00
Tim van der Meij
2f2e539bc6 Merge pull request #8561 from Snuffleupagus/zoomLayer-canvas-hidden
Don't use a hidden canvas when constructing the `zoomLayer` in `PDFPageView.update`
2017-06-22 23:51:21 +02:00
Tim van der Meij
c6ee05f7e5 Merge pull request #8542 from Rob--W/svg-clipping
Move svg:clipPath generation from clip to endPath
2017-06-22 23:48:06 +02:00