Commit Graph

14353 Commits

Author SHA1 Message Date
calixteman
03dff1c5f5
Merge pull request #13639 from calixteman/old_break
XFA - Replace deprecated break element (bug 1718053)
2021-06-28 17:44:03 +02:00
calixteman
191db4145e
Merge pull request #13642 from calixteman/quotes
XFA - Remove quotes of font name in xhtml
2021-06-28 13:25:47 +02:00
Calixte Denizet
677332aa7b XFA - Remove quotes of font name in xhtml 2021-06-27 18:05:12 +02:00
Calixte Denizet
257de0e8c5 XFA - Replace deprecated break element (bug 1718053)
- the break element has been deprecated in XFA 2.4 but some old documents can use it, so replace it with one (or more) of its possible substitutions:
    - breakBefore;
    - breakAfter;
    - overflow.
2021-06-27 15:03:00 +02:00
Tim van der Meij
d644b66c72
Merge pull request #13638 from Snuffleupagus/api-tweak-docs
A couple of smaller JSDocs tweaks in `src/display/api.js`
2021-06-27 12:47:57 +02:00
Tim van der Meij
4a8466cdac
Merge pull request #13637 from Snuffleupagus/update-packages
Update packages and translations
2021-06-27 12:42:54 +02:00
Jonas Jenwald
d02146b13b Add a OnProgressParameters typedef to reduce (some) duplication in src/display/api.js 2021-06-27 11:55:53 +02:00
Jonas Jenwald
ea4b162328 Use the RefProxy typedef in more JSDoc comments in src/display/api.js 2021-06-27 11:34:59 +02:00
Jonas Jenwald
0326c05db0 Update l10n files 2021-06-27 10:31:06 +02:00
Jonas Jenwald
b146c597b0 Fix (some) vulnerabilities reported by npm audit
This was done automatically, using the `npm audit fix` command.
2021-06-27 10:29:39 +02:00
Jonas Jenwald
e79ed27f2f Update the es-module-shims package to the latest version 2021-06-27 10:27:02 +02:00
Jonas Jenwald
f03d5b3ee7 Update npm packages 2021-06-27 10:25:40 +02:00
Tim van der Meij
d7f8a0e9b9
Merge pull request #13628 from Snuffleupagus/issue-13626
Check that TrueType (3, 0) cmap tables, for symbolic fonts, are sorted correctly (issue 13626)
2021-06-26 14:17:11 +02:00
Tim van der Meij
82660296d6
Merge pull request #13600 from Snuffleupagus/scrollMatchIntoView-selectedLeft
Take the position of the `selected` element into account when scrolling matches (issue 13596)
2021-06-26 14:04:20 +02:00
calixteman
9de0916fd4
Merge pull request #13627 from calixteman/save
XFA - Save filled data in the pdf when downloading the file (Bug 1716288)
2021-06-25 20:12:09 +02:00
Calixte Denizet
429ffdcd2f XFA - Save filled data in the pdf when downloading the file (Bug 1716288)
- when binding (after parsing) we get a map between some template nodes and some data nodes;
  - so set user data in input handlers in using data node uids in the annotation storage;
  - to save the form, just put the value we have in the storage in the correct data nodes, serialize the xml as a string and then write the string at the end of the pdf using src/core/writer.js;
  - fix few bugs around data bindings:
    - the "Off" issue in Bug 1716980.
2021-06-25 18:57:01 +02:00
Jonas Jenwald
50edd5da63 Suppress OTS warnings about the caretOffset in the hhea-table
- https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6hhea.html
 - https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6head.html
2021-06-25 17:02:02 +02:00
Jonas Jenwald
185be678ec Check that TrueType (3, 0) cmap tables, for symbolic fonts, are sorted correctly (issue 13626)
According to a comment in `readCmapTable`, we're assuming that the cmap tables (when more than one exist) are sorted in ascending order. If that's not the case, keep checking the following cmap tables in order to fix the referenced issue.
2021-06-25 16:56:00 +02:00
Brendan Dahl
dc7faa213e
Merge pull request #13624 from calixteman/center
XFA - Take into account text position in caption
2021-06-24 09:07:39 -07:00
Calixte Denizet
57b6746bab XFA - Take into account text position in caption 2021-06-24 10:25:41 +02:00
Brendan Dahl
d7fdb72a3f
Merge pull request #13619 from calixteman/bg
XFA - Add back empty subforms (which can have a background)
2021-06-23 16:21:28 -07:00
Brendan Dahl
ad28622595
Merge pull request #13622 from calixteman/no_stretch_lrtb
XFA - No container stretching with lr-tb layout
2021-06-23 15:06:21 -07:00
Brendan Dahl
f4f00a9bc6
Merge pull request #13618 from calixteman/bind_root
XFA - Always bind root subform on root data
2021-06-23 13:14:12 -07:00
Calixte Denizet
1d0e83e1bd XFA - No container stretching with lr-tb layout 2021-06-23 22:03:07 +02:00
Tim van der Meij
f74562b19c
Merge pull request #13613 from Snuffleupagus/xfa-printing-tweaks
[api-minor] Slightly tweak/improve various code related to XFA-printing
2021-06-23 21:56:29 +02:00
Tim van der Meij
ad4b2ce021
Merge pull request #13612 from Snuffleupagus/issue-13610
Support corrupt documents with *empty* `Name`-entries (issue 13610)
2021-06-23 21:49:02 +02:00
Tim van der Meij
c115be27b6
Merge pull request #13617 from Snuffleupagus/reset-externalLinkEnabled
Reset the `IPDFLinkService.externalLinkEnabled` property on document closing
2021-06-23 21:42:27 +02:00
Calixte Denizet
b836616667 XFA - Always bind root subform on root data
- it partially fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1717805 (on the data side at least but there is still a layout issue).
2021-06-23 20:46:41 +02:00
Calixte Denizet
f168998d93 XFA - Add back empty subforms (which can have a background) 2021-06-23 19:42:36 +02:00
calixteman
2bae399422
Merge pull request #13614 from calixteman/line_height
XFA - Get line height from the font
2021-06-23 14:57:27 +02:00
Jonas Jenwald
d959cb824d Reset the IPDFLinkService.externalLinkEnabled property on document closing
Given that this property is only used with password protected documents, and is consequently document-specific rather than viewer-specific, ensure that `IPDFLinkService.externalLinkEnabled` is actually being reset by `PDFViewerApplication.close`.

To make things less confusing/inconsistent, remove the *undocumented* `externalLinkEnabled` property from the `PDFLinkService` constructor and force it to always be manually set when needed.
2021-06-23 14:12:33 +02:00
Calixte Denizet
e82446fa5a XFA - Get line height from the font
- when the CSS line-height property is set to 'normal' then the value depends of the user agent. So use a line height based on the font itself and if for any reasons this value is not available use 1.2 as default.
  - it's a partial fix for https://bugzilla.mozilla.org/show_bug.cgi?id=1717681.
2021-06-23 14:11:10 +02:00
Jonas Jenwald
87be43c193 [api-minor] Add a new getXfaPageViewport helper function to support printing
This patch provides an overall simpler *and* more consistent way of handling the `viewport` parameter during printing of XFA forms, since it's now again guaranteed to always be an instance of `PageViewport`.
Furthermore, for anyone attempting to e.g. implement custom printing of XFA forms this probably cannot hurt either.
2021-06-23 08:17:58 +02:00
Jonas Jenwald
45c1390c42 Switch the order of the "display"/"print" intent handling in XfaLayerBuilder.render
Given that the "print"-intent is special, and that we should always fallback to the "display"-intent, let's ensure that the code actually reflects that.
Also, ensure that the method always returns a `Promise` since that's what the documentation says.
2021-06-23 08:17:58 +02:00
Jonas Jenwald
eb94d71b71 Move the getXfaHtmlForPrinting helper function to its own file (PR 13411 follow-up)
The `web/ui_utils.js` file should be usable from basically anywhere in the `web/`-folder, hence it should ideally not have any dependecies on its own and particularily *not* onces that pull in entire (large) factories.
2021-06-23 08:17:58 +02:00
Jonas Jenwald
9441245320
Merge pull request #13606 from Snuffleupagus/issue-13605
Correctly align the `textLayer` content with horizontal/spread scrolling modes (issue 13605)
2021-06-22 18:53:10 +02:00
calixteman
b1c9d8c78d
Merge pull request #13594 from calixteman/xfa_add_margin
XFA - Add margins if needed after having layout some text
2021-06-22 17:47:18 +02:00
Jonas Jenwald
6467907318 Support corrupt documents with *empty* Name-entries (issue 13610)
Apparently some really bad PDF software can create documents with *empty* `Name`-entries, which we thus need to somehow deal with.
While I don't know if this patch is necessarily the best solution, it should at least ensure that the *empty* `Name`-instance cannot accidentally match a proper `Name`-instance (and it doesn't require changes to a lot of existing code).[1]

---
[1] I briefly considered using a `Symbol` rather than an Object, but quickly decided against that since the former one [is not clonable](https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm#supported_types) and `Name`-instances may be sent to the API.
2021-06-22 16:55:44 +02:00
Jonas Jenwald
6163cd015b
Merge pull request #13609 from Snuffleupagus/xfaLayer-text-align
Correctly align the `xfaLayer` content with horizontal scrolling/spread modes
2021-06-22 14:54:21 +02:00
Jonas Jenwald
d301ec7d42 Correctly align the xfaLayer content with horizontal scrolling/spread modes
This extends the approach in PRs 12848 and 13606 to also apply to the `xfaLayer`, since otherwise XFA forms will be similarly broken in most non-default scroll/spread modes.
2021-06-22 13:31:48 +02:00
Calixte Denizet
aca102a35e XFA - Add margins if needed after having layout some text 2021-06-22 10:36:01 +02:00
Jonas Jenwald
eb755d098e
Merge pull request #13608 from mozilla/dependabot/npm_and_yarn/color-string-1.5.5
Bump color-string from 1.5.3 to 1.5.5
2021-06-22 10:08:19 +02:00
dependabot[bot]
f40c59c7b4
Bump color-string from 1.5.3 to 1.5.5
Bumps [color-string](https://github.com/Qix-/color-string) from 1.5.3 to 1.5.5.
- [Release notes](https://github.com/Qix-/color-string/releases)
- [Changelog](https://github.com/Qix-/color-string/blob/master/CHANGELOG.md)
- [Commits](https://github.com/Qix-/color-string/commits/1.5.5)

---
updated-dependencies:
- dependency-name: color-string
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 07:59:39 +00:00
calixteman
b886b6c995
Merge pull request #13604 from calixteman/xfa_proto_propr
XFA - A prototype can have a property which needs itself to resolve a proto
2021-06-22 09:58:29 +02:00
calixteman
e84b3bbf6e
Merge pull request #13592 from calixteman/xfa_print_only
XFA - Don't display print-only elements
2021-06-21 21:02:53 +02:00
calixteman
fbf5f8487d
Merge pull request #13603 from calixteman/revert
Revert "Revert "XFA - Fix the way to select page on breaking""
2021-06-21 19:11:44 +02:00
Jonas Jenwald
daa563ae81 Correctly align the textLayer content with horizontal/spread scrolling modes (issue 13605)
This is *very* similar to PR 12848, however for this `textLayer`-case it appears to only be an issue in documents with marked content.
2021-06-21 18:59:59 +02:00
Calixte Denizet
72c32b3498 XFA - A prototype can have a property which needs itself to resolve a proto 2021-06-21 17:26:29 +02:00
calixteman
56a75f8b26 Revert "Revert "XFA - Fix the way to select page on breaking"" - and fix the error which caused the backout: add an $extra property when creating html. - switch to next content area when breaking on page area. 2021-06-21 17:07:31 +02:00
calixteman
277f351291
Merge pull request #13601 from mozilla/revert-13573-bug1716838
Revert "XFA - Fix the way to select page on breaking"
2021-06-21 15:45:22 +02:00