Commit Graph

14758 Commits

Author SHA1 Message Date
calixteman
e962d7787e
Merge pull request #13451 from calixteman/xfa_checkbox
XFA - Use native radio and checkbox buttons
2021-06-02 22:02:41 +02:00
Jonas Jenwald
daf8461489 [GENERIC viewer] Fix printing regression from PR 13411
I missed this during review, since some of the changes in `web/pdf_print_service.js` broke printing.

Also, as part of these changes the patch replaces what looks like unnecessary `setAttribute` usage with "regular" `className` assignment and finally updates a couple of the CSS-rules to be more consistent.
2021-06-02 21:42:24 +02:00
Tim van der Meij
c7ca771caf
Merge pull request #13476 from Snuffleupagus/Puppeteer-10
Update Puppeteer to version 10
2021-06-02 21:29:17 +02:00
Brendan Dahl
1da42e8b8e Fix find highlighting regression from #13306.
When we insert extra spans for highlighting we want
them to be positioned normally instead of absolute or
relative.

Fixes #13345.
2021-06-01 15:25:40 -07:00
Calixte Denizet
f61f80a5a3 XFA - Use native radio and checkbox buttons
- Remove current stuff which relies on some system fonts to avoid bad rendering.
2021-06-01 21:25:38 +02:00
calixteman
f2ade671ec
Merge pull request #13411 from calixteman/xfa_print
XFA - Add support to print XFA forms
2021-06-01 19:06:49 +02:00
Jonas Jenwald
3456ed271b
Merge pull request #13378 from calixteman/10544
Replace terminal null char by a endchar command in CFF charstrings to make OTS happy
2021-06-01 16:04:09 +02:00
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
Calixte Denizet
a434011517 XFA - Add support to print XFA forms 2021-05-31 10:26:30 +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