Commit Graph

16208 Commits

Author SHA1 Message Date
Jonas Jenwald
bcdf161967
Merge pull request #15445 from Snuffleupagus/issue-15443
Extend `getSupplementalGlyphMapForCalibri` with more entries (issue 15443)
2022-09-15 22:56:44 +02:00
Jonas Jenwald
7a19def34c Extend getSupplementalGlyphMapForCalibri with more entries (issue 15443) 2022-09-15 22:19:16 +02:00
Jonas Jenwald
9bfd997c12
Merge pull request #15442 from Snuffleupagus/issue-15441
Extend `getGlyphMapForStandardFonts` with some quote-entries (issue 15441)
2022-09-15 13:11:06 +02:00
Jonas Jenwald
2f2ecad8fd Extend getGlyphMapForStandardFonts with some quote-entries (issue 15441) 2022-09-15 11:37:20 +02:00
Jonas Jenwald
c21d00ef44
Merge pull request #15430 from srmagura/webpack5
[api-minor] Use `new Worker()` syntax in webpack entrypoint
2022-09-14 10:32:01 +02:00
Sam Magura
1c2d200918 [api-minor] Use new Worker() syntax in webpack entrypoint
This requires Webpack 5 and will break for anyone using Webpack 4.
worker-loader no longer needs to be installed.
2022-09-13 11:12:00 -04:00
Jonas Jenwald
5e5aa9fb69
Merge pull request #15339 from Snuffleupagus/enable-editor
[api-major] Enable editing by default
2022-09-13 15:57:54 +02:00
Jonas Jenwald
5a6cdffb4b
Merge pull request #15431 from Snuffleupagus/bug-1790552
Disable the editing-indicator, in the document title, during printing (bug 1790552, PR 15351 follow-up)
2022-09-13 11:41:33 +02:00
Jonas Jenwald
00aef590cf Disable the editing-indicator, in the document title, during printing (bug 1790552, PR 15351 follow-up) 2022-09-13 11:33:24 +02:00
Jonas Jenwald
3e8394ee33 [api-major] Enable editing by default
Note that this patch *at least* shouldn't land until both [bug 1784272](https://bugzilla.mozilla.org/show_bug.cgi?id=1784272) and [bug 1785248](https://bugzilla.mozilla.org/show_bug.cgi?id=1785248) are fixed.
2022-09-12 14:58:31 +02:00
calixteman
493bb65005
Merge pull request #15425 from Snuffleupagus/cursor-failed-fullscreen
Don't try to update the cursorTool when switching to PresentationMode failed
2022-09-12 14:51:55 +02:00
calixteman
2d1d64b214
Merge pull request #15416 from calixteman/buttons_telemetry
Add some telemetry to know how often the buttons in the secondary toolbar are used (bug 1789883)
2022-09-12 13:59:45 +02:00
Jonas Jenwald
71f8680d66 Don't try to update the cursorTool when switching to PresentationMode failed
Currently this may print an Error message in the console, and while nothing breaks (since no actual Error is thrown) we should probably avoid this.
2022-09-12 13:36:37 +02:00
Calixte Denizet
05e4aed787 Add some telemetry to know how often the buttons in the secondary toolbar are used (bug 1789883) 2022-09-12 12:37:48 +02:00
Tim van der Meij
f63d584cb1
Merge pull request #15414 from Snuffleupagus/mv-PDFViewer
Remove the abstract `BaseViewer`-class
2022-09-10 13:37:04 +02:00
Tim van der Meij
ae12a219d1
Merge pull request #15420 from Snuffleupagus/issue-15419
Send the `verbosity` when using a workerPort (issue 15419)
2022-09-10 13:31:47 +02:00
Jonas Jenwald
a274f63d50
Merge pull request #15421 from Snuffleupagus/separator-followup
Fix the visibility of a separator in the secondaryToolbar (PR 15391 follow-up)
2022-09-09 18:54:37 +02:00
Jonas Jenwald
4189a8567e Fix the visibility of a separator in the secondaryToolbar (PR 15391 follow-up)
After the changes in PR 15391 one separator may now become visible too soon when the viewer is narrow, applies e.g. to the MOZCENTRAL viewer, since the wrong CSS class is being used.
The reason that this happens is that only the GENERIC viewer includes the "openFile"-buttons, and we thus need the separator to also be conditionally defined.
2022-09-09 17:50:29 +02:00
Jonas Jenwald
d846b8601e Send the verbosity when using a workerPort (issue 15419)
This *should* fix issue 15419, but given the lack of a runnable example it's difficult to know for sure.
2022-09-09 11:47:26 +02:00
Jonas Jenwald
a21ce7ac8b
Merge pull request #15418 from Snuffleupagus/pr-15319-followup
Don't listen for window resolution changes in old browsers (PR 15319 follow-up)
2022-09-09 11:18:15 +02:00
Jonas Jenwald
c36205f10d Don't listen for window resolution changes in old browsers (PR 15319 follow-up)
This is a slightly speculative change, based on something that I happened to notice while browsing MDN, to hopefully prevent PDF.js from outright breaking in older browsers.
According to the following information on MDN, Safari didn't implement support for the necessary features until version 14:
 - https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList#browser_compatibility
 - https://developer.mozilla.org/en-US/docs/Web/API/MediaQueryList/change_event#browser_compatibility

Given the browsers that we currently support only older versions of Safari should be affected, hence it seems reasonable to simply disable the functionality rather than trying to polyfill it.
(It's interesting how it's very often Safari which is *much* slower than the other browsers at implementing new features.)
2022-09-09 10:39:35 +02:00
Jonas Jenwald
21fe5017bb Remove the abstract BaseViewer-class
After the changes in PR 14112 the `PDFViewer`-class is now "identical" to the `BaseViewer`-class and the `PDFSinglePageViewer`-class is just a very thin wrapper around the `BaseViewer`-class.
Hence we can rename these files, and also remove the abstract `BaseViewer`-class, which helps reduce some unnecessary "closures" in the *built* viewer.

*Please note:* These changes are made in two separate commits, to allow GitHub to preserve `blame` for the affected files.
2022-09-08 12:38:17 +02:00
Jonas Jenwald
6dc4c994b8 Remove the abstract BaseViewer-class
After the changes in PR 14112 the `PDFViewer`-class is now "identical" to the `BaseViewer`-class and the `PDFSinglePageViewer`-class is just a very thin wrapper around the `BaseViewer`-class.
Hence we can rename these files, and also remove the abstract `BaseViewer`-class, which helps reduce some unnecessary "closures" in the *built* viewer.

*Please note:* These changes are made in two separate commits, to allow GitHub to preserve `blame` for the affected files.
2022-09-08 12:38:17 +02:00
calixteman
b0a021d2cc
Merge pull request #15413 from calixteman/items_size
Set a display value for the secondary toolbar buttons
2022-09-08 12:35:08 +02:00
Calixte Denizet
f8ae49d20b Set a display value for the secondary toolbar buttons
and remove a useless property: visibleSmallView.
2022-09-08 12:19:21 +02:00
Calixte Denizet
e56c30eb59 Move 'presentation mode' and 'bookmarks' buttons in the secondary toolbar (bug 1789082) 2022-09-08 12:18:08 +02:00
calixteman
6852001b02
Merge pull request #15384 from calixteman/icons
Update some icons in the toolbar (bug 1739965)
2022-09-07 11:48:27 +02:00
Calixte Denizet
90c69876ca Update some icons in the toolbar (bug 1739965) 2022-09-07 10:45:03 +02:00
Jonas Jenwald
af6aacfc0e
Merge pull request #15398 from Snuffleupagus/more-optional-chaining
Use more optional chaining in the code-base
2022-09-06 20:31:03 +02:00
Jonas Jenwald
95e3f5d495
Merge pull request #15402 from Snuffleupagus/rm-telemetry-tagged
Remove the "tagged" telemetry-reporting
2022-09-06 14:21:52 +02:00
Jonas Jenwald
c70ceecff4 Remove the "tagged" telemetry-reporting
Given that this is no longer being recorded in Firefox, it shouldn't be necessary to keep the associated code in the default viewer.
2022-09-06 13:00:44 +02:00
Jonas Jenwald
b4b9ce83ed
Merge pull request #15397 from Snuffleupagus/getEexecBlock-empty
Fallback to a standard font when a Type1 font program is empty (issue 15292)
2022-09-06 10:27:37 +02:00
Jonas Jenwald
38ee28b1d3 Use more optional chaining in the code-base
This patch updates a bunch of older code, that makes conditional function calls, to use optional chaining rather than `if`-blocks.

These mostly mechanical changes reduce the size of the `gulp mozcentral` build by a little over 1 kB.
2022-09-05 15:41:53 +02:00
Jonas Jenwald
947d390421 Fallback to a standard font when a Type1 font program is empty (issue 15292)
*Please note:* This is only a, hopefully generally helpful, work-around rather than a proper solution to issue 15292.

There's something that's "special" about the Type1 fonts in the referenced PDF document, since we don't manage to find any actual font programs and thus cannot render anything.
Given that it shouldn't make sense for a Type1 font program to ever be empty, since that means that there's no glyph-data to render, we simply fallback to a standard font to at least try and render *something* in these rare cases.
2022-09-05 12:07:19 +02:00
Jonas Jenwald
9578152ae4
Merge pull request #15392 from Snuffleupagus/issue-15352
Don't allow `adjustToUnicode` to extend a built-in /ToUnicode map (issue 15352)
2022-09-04 15:12:10 +02:00
calixteman
72375ed652
Merge pull request #15395 from calixteman/15340
Don't replace cr by a white space when the last char on the line is an ideographic char
2022-09-04 14:30:22 +02:00
Calixte Denizet
6c6f6fb2b8 Don't replace cr by a white space when the last char on the line is an ideographic char 2022-09-04 14:21:05 +02:00
Tim van der Meij
e3874dab7c
Merge pull request #15394 from Snuffleupagus/update-packages
Update packages and translations
2022-09-04 13:52:23 +02:00
Jonas Jenwald
a65cc8d26d Update l10n files 2022-09-04 10:16:40 +02:00
Jonas Jenwald
21042371e6 Update npm packages 2022-09-04 10:16:40 +02:00
Jonas Jenwald
12d60e0acf Don't allow adjustToUnicode to extend a built-in /ToUnicode map (issue 15352)
Given that the change in PR 13393 was slightly speculative, given the lack of test-cases, let's just revert part of that to fix the referenced issue.
Based on a quick look at old issues and existing test-cases, it seems that most (if not all) PDF documents that benefit from using the font-data in this way lack any /ToUnicode maps which should mean that they're unaffected by these changes.
2022-09-03 23:11:42 +02:00
Tim van der Meij
50d72fc111
Merge pull request #15377 from Snuffleupagus/SetOCGState
[api-minor] Add basic support for the `SetOCGState` action (issue 15372)
2022-09-03 13:26:06 +02:00
Tim van der Meij
d16f591183
Merge pull request #15390 from Snuffleupagus/rm-bower
Remove Bower support in `pdfjs-dist`
2022-09-03 13:21:28 +02:00
Jonas Jenwald
5b903a6e2d Remove Bower support in pdfjs-dist
Given that the official Bower website, since almost five years, has been advising users to utilize other tools it doesn't seem entirely necessary to keep including the `bower.json` file in the `pdfjs-dist` repository; see e.g. https://bower.io/blog/2017/how-to-migrate-away-from-bower/
2022-09-03 13:05:59 +02:00
Tim van der Meij
783c722661
Merge pull request #15360 from Snuffleupagus/Popup-IGNORE_TYPES
Properly ignore PopupAnnotations with custom `trigger`-elements
2022-09-03 12:56:38 +02:00
Tim van der Meij
41c14f84dd
Merge pull request #15388 from Snuffleupagus/rm-browserify
Remove the `browserify` example
2022-09-03 12:29:14 +02:00
Jonas Jenwald
2075800828 Remove the browserify example
This patch proposes removing the `browserify` example for the following reasons:
 - The last `browserify` release was almost two years ago, according to both https://github.com/browserify/browserify/releases and https://www.npmjs.com/package/browserify?activeTab=versions
 - The project no longer seems to be actively maintained, since so far this year there's only been *a single* (seemingly trivial) patch merged; see https://github.com/browserify/browserify/commits/master
 - Because of the previous points `browserify` doesn't support modern and up-to-date JavaScript features, as evident from e.g. issue 14731 and multiple issues found in https://github.com/browserify/browserify/issues
 - Our `browserify` example is most likely not very commonly used, judging by the very low volume of issues/PRs related to it. Looking at the `git` history of that example the only changes have been lint- or maintenance-related.[1]
 - Providing an example for a framework that's no longer actively maintained doesn't seem like a good idea in general, since we probably don't want to steer users towards using (possibly) older frameworks.
 - Given that we've never used `browserify` in the PDF.js project, it's also quite difficult to provide support for the example.

---
[1] It's interesting to compare with the `webpack` example, since that's generated both issues *and* also PRs (for missing features) from users.
2022-09-02 18:15:42 +02:00
calixteman
c503006b2e
Merge pull request #15386 from calixteman/text_cursor
[Editor] Change the cursor when we switch to FreeText mode (bug 1787297)
2022-09-02 17:58:00 +02:00
Calixte Denizet
1b14b06e4c [Editor] Change the cursor when we switch to FreeText mode (bug 1787297) 2022-09-02 15:17:24 +02:00
calixteman
51035194d9
Merge pull request #15385 from calixteman/editor_icons
Update editing icons (bug 1785248)
2022-09-02 13:28:12 +02:00