Commit Graph

14148 Commits

Author SHA1 Message Date
Jonas Jenwald
bc17ac5a2f Update Puppeteer to version 10
Hopefully the updated Chromium-version might help reduce the number of intermittent test failures.

Please find additional information at https://github.com/puppeteer/puppeteer/releases/tag/v10.0.0
2021-06-01 15:11:02 +02:00
calixteman
706c27b9d4
Merge pull request #13472 from Snuffleupagus/checkbox-print-evaluator
Don't change options of the globally used `PartialEvaluator` in the "should render checkbox with fallback font for printing" unit-test
2021-05-31 14:06:38 +02:00
Jonas Jenwald
af78ba64bd Don't change options of the globally used PartialEvaluator in the "should render checkbox with fallback font for printing" unit-test
Given that the same `PartialEvaluator`-instance is used for a lot of these unit-tests, manually changing the options in any one test-case could lead to intermittently failing unit-tests since they're run in a random order.
To fix this, we simply have to use the existing method to clone the `PartialEvaluator`-instance but with the custom options.
2021-05-31 12:14:58 +02:00
Jonas Jenwald
e3bde56311 Ensure that the old/new options are correctly combined in PartialEvaluator.clone 2021-05-31 12:14:53 +02:00
calixteman
8c53bf8647
Merge pull request #13437 from calixteman/xfa_mv_root
XFA - Move the fake HTML representation of XFA from the worker to the main thread
2021-05-31 10:14:15 +02:00
Tim van der Meij
dd0014ef2e
Merge pull request #13465 from Snuffleupagus/misc-legacy-cleanup
Some `-es5`/`-legacy` renaming clean-up, and `deprecated` API options removal (PR 12978, PR 13207 follow-up)
2021-05-30 21:13:42 +02:00
Tim van der Meij
a592bea37e
Merge pull request #13466 from eltociear/patch-3
Fix typo in template.js
2021-05-30 21:08:58 +02:00
Ikko Ashimine
c66289f1fc
Fix typo in template.js
refering -> referring
2021-05-31 01:02:07 +09:00
Jonas Jenwald
d8a7c75b4a Revert "Add deprecated handling of the now removed AnnotationStorage API-parameters" (PR 13207 follow-up)
This reverts commit 737a8e846d, since it's included in the latest beta version `2.9.359`.
2021-05-30 16:38:33 +02:00
Jonas Jenwald
13dbbdcfb0 Remove the -es5/-legacy special handling in the gulp wintersmith task (PR 12978 follow-up)
With the stable version now being `2.8.335`, this work-around is no longer necessary.
2021-05-30 16:08:54 +02:00
Tim van der Meij
d05f4c620e
Merge pull request #13464 from timvandermeij/bump
Bump versions in `pdfjs.config`
2021-05-30 14:17:13 +02:00
Tim van der Meij
9b0ea437c5
Bump versions in pdfjs.config 2021-05-30 14:15:09 +02:00
Tim van der Meij
e667c8cbcf
Merge pull request #13463 from mozilla/dependabot/npm_and_yarn/ws-7.4.6
Bump ws from 7.4.5 to 7.4.6
2021-05-30 13:08:08 +02:00
dependabot[bot]
03d826affa
Bump ws from 7.4.5 to 7.4.6
Bumps [ws](https://github.com/websockets/ws) from 7.4.5 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.4.5...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-30 10:58:18 +00:00
Tim van der Meij
2cd038857a
Merge pull request #13462 from Snuffleupagus/update-packages
Update packages and translations
2021-05-30 12:57:15 +02:00
Jonas Jenwald
0bfd99ae98 Update l10n files 2021-05-30 08:02:55 +02:00
Jonas Jenwald
4ef538b19a Update the yargs package to the latest version 2021-05-30 07:51:30 +02:00
Jonas Jenwald
e7ab2d6eb5 Update the eslint-plugin-unicorn package to the latest version 2021-05-30 07:50:12 +02:00
Jonas Jenwald
fd6d60935b Update npm packages 2021-05-30 07:43:13 +02:00
Tim van der Meij
d725ff36f1
Merge pull request #13460 from nikolas/patch-1
Update webpack import instructions
2021-05-29 15:43:34 +02:00
nikolas
4902f9a54a
Update webpack import instructions
This resolves an issue I had when loading pdf.js with webpack. `pdfjsLib` was always `undefined` after the import, and I dug deep into pdf.js's `webpack.js` file to sort out this issue, making all sorts of changes.

I figured out that there was just something wrong with the export/import procedure. After making this change, I now have the full pdfjs object in my webpack application.
2021-05-28 20:46:56 -04:00
Tim van der Meij
a0ce3cb3b4
Merge pull request #13448 from Snuffleupagus/_setDefaultAppearance-alpha
Support strokeAlpha/fillAlpha when creating a fallback appearance stream (issue 6810)
2021-05-28 23:39:36 +02:00
Tim van der Meij
5e5641b147
Merge pull request #13457 from Snuffleupagus/issue-13242
Work-around for HighlightAnnotations without a top-level /ExtGState-entry (issue 13242)
2021-05-28 23:38:39 +02:00
Tim van der Meij
0d56b1c365
Merge pull request #13443 from Snuffleupagus/charsCache
Re-factor the `charsCache` on `Font`-instances
2021-05-28 21:29:57 +02:00
Brendan Dahl
a6484c9861
Merge pull request #13427 from calixteman/xfa_storage
XFA - Add a storage to save fields values
2021-05-28 12:10:08 -07:00
Jonas Jenwald
707a9e3b02 Work-around for HighlightAnnotations without a top-level /ExtGState-entry (issue 13242)
For HighlightAnnotations with a built-in appearance stream, we still rely on it to specify the opacity correctly via a suitable blend mode. However, if the Annotation-drawing operators are placed *within* a /XObject of the /Form-type, the /ExtGState won't apply to the final rendering and the result is that the highlighting obscures the underlying text.

The more *correct* and general solution would likely be to somehow modify the implementation in `src/display/canvas.js`, to special-case handling of /Form-type /XObjects when rendering Annotations. Since we can very easily work-around this problem for now by using the "no appearance stream" code-path, doing *something* here ought to be preferable.

This patch is (obviously) merely a work-around, but given that the referenced issue is (as far as I know) the first case we've seen of this problem a simple solution will hopefully suffice for now.
2021-05-28 13:49:27 +02:00
calixteman
e499521b78
Merge pull request #13456 from calixteman/clazz
Replace clazz by classNames
2021-05-28 12:18:27 +02:00
Jonas Jenwald
2cc3b96351
Merge pull request #13455 from calixteman/italic
Italic angle is defined clockwise in CSS when it's counterclockwise in PDF
2021-05-28 11:49:48 +02:00
Calixte Denizet
f35176a32e Replace clazz by classNames 2021-05-28 11:17:38 +02:00
Calixte Denizet
1b0006093d Italic angle is defined clockwise in CSS when it's counterclockwise in PDF 2021-05-28 11:06:11 +02:00
calixteman
d285580f48
Merge pull request #13450 from Snuffleupagus/getPageIndex-JSDoc
Fix the JSDocs for `PDFDocumentProxy.getPageIndex` (issue 13449)
2021-05-27 17:25:41 +02:00
Jonas Jenwald
70c79c6f69 Fix the JSDocs for PDFDocumentProxy.getPageIndex (issue 13449) 2021-05-27 16:41:08 +02:00
Jonas Jenwald
52c13326cd Support Annotations, without appearance streams, with bogus /Rect-entries (issue 13447)
This extends PR 13106 to apply not only to empty /Rect-entries, but also to bogus /Rect-entries for various Annotation-types.
2021-05-27 16:23:21 +02:00
Jonas Jenwald
a6447f2ca2 Support strokeAlpha/fillAlpha when creating a fallback appearance stream (issue 6810)
This fixes the colours, by respecting the strokeAlpha/fillAlpha-values, for a couple of Annotations in the PDF document from issue 13447.[1]

---
[1] Some of the annotations still won't render at all, when compared with Adobe Reader, but that could/should probably be handled separately.
2021-05-27 16:23:18 +02:00
calixteman
f587d5998e
Merge pull request #13445 from calixteman/ps_name
Fix Postscript name in font to avoid bug when saving in pdf
2021-05-27 13:52:47 +02:00
Calixte Denizet
0c698346b8 Fix Postscript name in font to avoid bug when saving in pdf
- for xfa rendering, fonts are loaded and used in html;
  - when printed and saved in pdf, on linux, Firefox uses cairo backend
  - when subsetting a font, cairo uses the font postscript name and when this one is empty that leads to a bug
    (the append at 63f0d62684/src/cairo-cff-subset.c (L2049) is failing because of null length)
  - so this patch adds a postscript name to the font to make cairo happy.
2021-05-27 12:45:40 +02:00
Jonas Jenwald
8b1d01816b Re-factor the charsCache on Font-instances
Currently `charsCache` is initialized *lazily*, which considering that it just contains a simple `Object` doesn't seem entirely necessary. This first of all forces us to do repeated exists-checks in the `Font.charsToGlyphs` method, and secondly the similar/related `glyphCache` is already initialized eagerly.

Furthermore, this patch also does a bit of clean-up in the `Font.charsToGlyphs` method since this code is quite old.
2021-05-26 13:13:44 +02:00
Tim van der Meij
3da9f077be
Merge pull request #13435 from Snuffleupagus/eslint-no-array-push-push
Enable the `unicorn/no-array-push-push` ESLint plugin rule
2021-05-25 21:10:01 +02:00
Tim van der Meij
6e92b56efa
Merge pull request #13436 from Snuffleupagus/getPathGenerator-buf
Re-factor FontFaceObject.getPathGenerator to use Arrays instead of strings
2021-05-25 20:35:01 +02:00
Tim van der Meij
774f4da9cb
Merge pull request #13429 from mozilla/dependabot/npm_and_yarn/browserslist-4.16.6
Bump browserslist from 4.16.3 to 4.16.6
2021-05-25 20:29:46 +02:00
Calixte Denizet
45c3f00a27 XFA - Move the fake HTML representation of XFA from the worker to the main thread
- the only goal of this patch is to be able to get synchronously the fake html when printing from firefox:
    - in order to print we need to inject some html in beforeprint callback but we cannot block in waiting for all the pages.
  - from a memory point of view: it doesn't change anything since the fake HTML is deleted in the worker;
  - this way we don't break any assumptions.
2021-05-25 19:33:07 +02:00
Calixte Denizet
9478d2f064 XFA - Add a storage to save fields values - this is required to be able to print (or save) a document. Some pages can be unloaded (because pdf.js is lazy) and this storage will help to save their data in order to resuse them when printing or just when displaying a page again. 2021-05-25 19:25:09 +02:00
calixteman
4d26623e59
Merge pull request #13402 from calixteman/xfa_layout1
XFA - Fix lot of layout issues
2021-05-25 18:31:53 +02:00
Calixte Denizet
7cebdbd58c XFA - Fix lot of layout issues
- I thought it was possible to rely on browser layout engine to handle layout stuff but it isn't possible
    - mainly because when a contentArea overflows, we must continue to layout in the next contentArea
    - when no more contentArea is available then we must go to the next page...
    - we must handle breakBefore and breakAfter which allows to "break" the layout to go to the next container
  - Sometimes some containers don't provide their dimensions so we must compute them in order to know where to put
    them in their parents but to compute those dimensions we need to layout the container itself...
  - See top of file layout.js for more explanations about layout.
  - fix few bugs in other places I met during my work on layout.
2021-05-25 17:51:36 +02:00
Jonas Jenwald
9ad7746118 Replace a couple of standard for-loops with for...of in src/display/font_loader.js 2021-05-25 14:11:57 +02:00
Jonas Jenwald
dcbb23d7fa Re-factor FontFaceObject.getPathGenerator to use Arrays instead of strings
This is similar to a lot of other code, where we use "Array + join" rather than repeated string concatenation.
2021-05-25 14:11:54 +02:00
Jonas Jenwald
ec3bcadf56 Enable the unicorn/no-array-push-push ESLint plugin rule
There's generally speaking no need to use multiple consecutive `Array.prototype.push()` calls, since that method accepts multiple arguments, and this ESLint rule helps enforce that pattern.

Please see https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-array-push-push.md for additional information.
2021-05-25 13:54:46 +02:00
dependabot[bot]
4f853f7669
Bump browserslist from 4.16.3 to 4.16.6
Bumps [browserslist](https://github.com/browserslist/browserslist) from 4.16.3 to 4.16.6.
- [Release notes](https://github.com/browserslist/browserslist/releases)
- [Changelog](https://github.com/browserslist/browserslist/blob/main/CHANGELOG.md)
- [Commits](https://github.com/browserslist/browserslist/compare/4.16.3...4.16.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 20:40:00 +00:00
Tim van der Meij
3538ef017f
Merge pull request #13421 from calixteman/no_remote_image
XFA - Don't display images with a href
2021-05-22 16:06:33 +02:00
Tim van der Meij
9127e11022
Merge pull request #13420 from timvandermeij/test-downloadutils
Drop obsolete logic from the `downloadFile` function in `test/downloadutils.js`
2021-05-22 15:58:51 +02:00