Commit Graph

10710 Commits

Author SHA1 Message Date
Tim van der Meij
e0b63cc7af
Update packages and translations 2018-04-08 15:49:17 +02:00
Tim van der Meij
1a634f9c6a
Merge pull request #9629 from wojtekmaj/add-autoprefixer
Implement autoprefixer
2018-04-08 15:11:41 +02:00
Tim van der Meij
69e9fe2494
Provide a prefixed appearance CSS rule for reference testing in Chrome
In `rasterizeAnnotationLayer` we load the source CSS files directly, so
these are not processed by Autoprefixer. Since the prefixed rules have
now been removed from the source CSS files, we must manually provide one
prefixed rule that Chrome needs in the overrides CSS file for checkbox
and radio button rendering to work in the reference tests.
2018-04-08 13:54:16 +02:00
Wojciech Maj
acd1fa4c4f Configure Autoprefixer 2018-04-04 23:02:26 +02:00
Wojciech Maj
ed67c1d6aa Introduce autoprefixer to gulp process 2018-04-04 00:26:01 +02:00
Wojciech Maj
dbb0e88bc1 Clean up browser-specific CSS 2018-04-04 00:25:12 +02:00
Brendan Dahl
a7a034d803
Merge pull request #9566 from brendandahl/remove-ff-ext
Remove the Firefox extension building code.
2018-04-03 13:45:38 -07:00
Brendan Dahl
e8cf7fd512
Merge pull request #9624 from wojtekmaj/no-warning-on-dependency-operator
Prevent warning on unimplemented operator thrown for OPS.dependency
2018-04-03 10:55:29 -07:00
Brendan Dahl
d21eecefc1
Merge pull request #9620 from wojtekmaj/fix-typos
Fix typos
2018-04-03 10:54:29 -07:00
Wojciech Maj
acc0a0fe95 Prevent warning on unimplemented operator thrown for OPS.dependency 2018-04-02 14:29:34 +02:00
Wojciech Maj
ea2850e9a7 Fix typos 2018-04-01 23:20:41 +02:00
Tim van der Meij
2f63ca0705
Merge pull request #9619 from timvandermeij/systemjs
Pin `systemjs` to avoid breakage
2018-04-01 13:19:03 +02:00
Tim van der Meij
6896d30037
Pin systemjs to avoid breakage
SystemJS version 0.21.0 works, but version 0.21.1 breaks with various
`Unable to load transpiler to transpile` errors. Pin the version to
0.21.0 for now to avoid this issue.
2018-04-01 13:07:26 +02:00
Tim van der Meij
57e8676180
Merge pull request #9618 from timvandermeij/node-example
Improve the instructions and code for the `pdf2png` example
2018-04-01 12:57:14 +02:00
Tim van der Meij
64b1315bb5
Improve the instructions and code for the pdf2png example
We need to pass `disableFontFace` and `nativeImageDecoderSupport`
because Node.js has no native support for `@font-face` and `Image`.
Doing so makes it possible to render e.g., the Tracemonkey paper, which
failed before. I made this PDF file the default because it's also the
default in other examples/demos and because it showcases the
possibilities better than the very simple hello world PDF file.

Building the library with `gulp dist-install` is easier and is already
recommended in the other examples.
2018-04-01 12:52:57 +02:00
Tim van der Meij
8887a09e8f
Merge pull request #9588 from swftvsn/patch-1
Improve node.js support
2018-04-01 12:26:39 +02:00
Tim van der Meij
8512596508
Merge pull request #9611 from Snuffleupagus/getMainThreadWorkerMessageHandler-non-PRODUCTION
Clean-up `getMainThreadWorkerMessageHandler` for non-PRODUCTION mode
2018-03-31 15:03:21 +02:00
Brendan Dahl
121e43685f Remove the Firefox extension building code.
Firefox no longer supports this legacy extension and it is a pain to
sync changes from here and mozilla central.
2018-03-30 16:27:50 -07:00
Jonas Jenwald
8b09f7c34e Clean-up getMainThreadWorkerMessageHandler for non-PRODUCTION mode
*This is a final piece of clean-up of code that I recently wrote, after which I'm done :-)*

When the `getMainThreadWorkerMessageHandler` function was added, in PR 9385, it did so by basically introducing a `web/app.js` dependency in `src/display/api.js` through the `window.pdfjsNonProductionPdfWorker` property[1]. Even though this is limited to non-`PRODUCTION` mode, i.e. `gulp server`, it still seems unfortunate to have that sort of viewer dependency in the API code itself.

With the new, much nicer and shorter, names introduced in PR 9565 we can remove this non-`PRODUCTION` hack and just use `window.pdfjsWorker` in both the viewer and the API regardless of the build mode.

---

[1] It didn't seem correct to piggy-back on the `window.pdfjsDistBuildPdfWorker` property in non-`PRODUCTION` mode.
2018-03-29 11:03:47 +02:00
Tim van der Meij
a8e9f6cc29
Merge pull request #9593 from Snuffleupagus/pageSize-orientation
Improve the pageSize entry in the document properties dialog, by also displaying page names and orientation
2018-03-25 21:52:11 +02:00
Jonas Jenwald
b004308f88 Attempt to improve the detection of (metric) page names, by fuzzy matching the dimensions
The following is an example of a PDF file (the specification to be exact) where the page size (compare the size displayed in Adobe Reader), and the page name, isn't correctly displayed without the patch: https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/PDF32000_2008.pdf
2018-03-25 18:53:45 +02:00
Jonas Jenwald
d86b816c2b Display the names, for a couple of standard page sizes, in the document properties dialog
Please note that this patch *purposely* doesn't add every standard (or semi-standard) page name in existence, but rather only a few common ones. This is done to lessen the burden on localizers, since it's quite possible that all of the page names could need translation (depending on locale).

It's easy to add more standard page sizes in the future, but we should take care to *only* add those that are very commonly used in actual PDF files.
2018-03-25 18:50:17 +02:00
Jonas Jenwald
fc0038d609 Add orientation description to the pageSize information, displayed in the properties dialog
Since the l10n strings were added in a previous commit, modifying them here shouldn't be a problem since they haven't landed in mozilla-central yet.
2018-03-25 18:50:17 +02:00
Jonas Jenwald
f3b74c5028 Display the pageSize, in the document properties dialog, with locale dependent units
This uses a whitelist, based on the locale, to determine where non-metric units should be used.
Note that the behaviour implemented here seem consistent with desktop PDF viewers (e.g. Adobe Reader), where the pageSizes are *always* displayed with locale dependent units rather than pageSize dependent ones (since the latter would probably be quite confusing).
2018-03-25 18:49:46 +02:00
Jonas Jenwald
513412c92e Add a new getLanguage method to the various IL10n implementations 2018-03-25 18:49:46 +02:00
Jonas Jenwald
ab74b32054 Adjust the displayed pageSize, in the document properties dialog, depending on the current *viewer* rotation (PR 9586 follow-up)
Please note that the behaviour implemented here mirrors the one used in Adobe Reader.
2018-03-25 18:49:46 +02:00
Jonas Jenwald
b7b5d93231 Reduce the duplication for the document_properties_page_size_* strings, by defining the units separately 2018-03-25 18:48:53 +02:00
Jonas Jenwald
77d025dc14 Move the isPortraitOrientation helper function from web/base_viewer.js to web/ui_utils.js
A couple of basic unit-tests are added, and a manual `isLandscape` check (in `web/base_viewer.js`) is also converted to use the helper function instead.
2018-03-25 18:48:53 +02:00
Tim van der Meij
5c1a16ba6e
Merge pull request #9586 from Snuffleupagus/pageSize-api-rotate
Ensure that `PDFPageProxy.pageSizeInches` handles non-default /Rotate entries correctly
2018-03-25 18:03:32 +02:00
Tim van der Meij
6cc0efe1cc
Merge pull request #9576 from timvandermeij/versions
Update packages
2018-03-25 17:52:26 +02:00
Tim van der Meij
95de23e6e3
Update packages
Jasmine had a major version bump and required a few minor changes in our
booting code. Most notably, using `pending` in a `describe` block is no
longer supported, so we can only return early there. On the positive
side, the unit tests now run in a random order by default, which
eliminates any dependencies between unit tests.

Note that upgrading to Webpack 4 is out of scope for this patch since
the bots cannot work well with the newly generated bundles (both
browsers on both bots do not react within 120 seconds). Webpack 4 is not
faster for us than Webpack 3, so for now there is no need to upgrade.
2018-03-25 16:59:50 +02:00
Jonas Jenwald
d547936827 Ensure that PDFPageProxy.pageSizeInches handles non-default /Rotate entries correctly
Without this patch, the pageSize will be incorrectly reported for some PDF files.

---

Move pageSizeInches to ui_utils
2018-03-25 16:48:29 +02:00
Tim van der Meij
115fbc47fe
Merge pull request #9594 from Snuffleupagus/pageLabel-validation
Add stricter validation in `Catalog.readPageLabels`
2018-03-24 19:40:49 +01:00
Brendan Dahl
24f766b14d
Merge pull request #9573 from yurydelendik/xml_parser
New XML parser
2018-03-21 17:00:00 -07:00
Jonas Jenwald
374d074f6e Add stricter validation in Catalog.readPageLabels
The current PageLabel dictionary validation code won't catch some (unlikely) forms of corruption. For example: a `Type`/`S` entry being `null`/`0`/empty string, a `P`/`St` entry being `null`/`0`.

Please note: I'm not aware of any bugs caused by the old code, but I've had this patch sitting locally for some time and figured it couldn't hurt to submit it.
2018-03-21 14:36:05 +01:00
swftvsn
c20426efef Improve node.js support
This change fixes "Unhandled rejection ReferenceError: HTMLElement is not defined" issue that is discussed in more detail in #8489.
2018-03-21 13:43:53 +02:00
Brendan Dahl
b67f117b56
Merge pull request #9590 from brendandahl/new-line
Add new line to default preferences.
2018-03-20 16:42:19 -07:00
Brendan Dahl
0aa31a493b Add new line to default preferences. 2018-03-20 16:36:37 -07:00
Tim van der Meij
c0b22da02a
Merge pull request #9584 from Rob--W/docs-examples-2.0
Update examples/ documentation for 2.0
2018-03-20 23:20:02 +01:00
Brendan Dahl
63c7aee112
Merge pull request #9565 from brendandahl/new-name
Rename the globals to shorter names.
2018-03-20 13:49:04 -07:00
Yury Delendik
655c8d34d0 New XML parser 2018-03-19 20:51:41 -05:00
Tim van der Meij
3bfc797bc7
Merge pull request #9587 from Snuffleupagus/cursorToolOnLoad
Move the `cursorToolOnLoad` preference handling into `AppOptions` (PR 9493 follow-up)
2018-03-19 23:51:42 +01:00
Jonas Jenwald
3131c9b54c Remove the deprecated mozL10n and localized properties from web/ui_utils.js
With PDF.js version `2.0`, these can now be removed.
2018-03-19 23:32:19 +01:00
Jonas Jenwald
c2f1523f06 Move the cursorToolOnLoad preference handling into AppOptions (PR 9493 follow-up)
Since no other viewer component is currently reading preferences itself, this patch thus unifies the behaviour across the viewer.
2018-03-19 23:24:56 +01:00
Brendan Dahl
6db9c3cb49
Merge pull request #9571 from Snuffleupagus/addon-prefs
[Firefox addon] Refactor bundling of the `default_preferences.json` file
2018-03-19 15:06:47 -07:00
Rob Wu
362da3bc05 Use pdfjsLib instead of PDFJS in examples
pdfjsLib is used in PDF.js 2.x,
PDFJS was the old namespace from 1.x.
2018-03-19 16:44:54 +01:00
Rob Wu
b0fe0f41db [docs] Link to other examples from examples page 2018-03-19 16:44:32 +01:00
Tim van der Meij
0d391daccc
Merge pull request #9577 from Snuffleupagus/pagesize-info-fixes
[api-minor] Fix various issues related to pageSize, and display the size for the active page in the document properties dialog
2018-03-18 15:01:21 +01:00
Tim van der Meij
4136d41a4c
Merge pull request #9574 from timvandermeij/l10n
Update translations
2018-03-18 14:49:30 +01:00
Jonas Jenwald
51ddcd6380 Display the pageSize of the *currently* active page in the document properties dialog 2018-03-18 09:10:21 +01:00