Commit Graph

14192 Commits

Author SHA1 Message Date
dependabot[bot]
0fad999fc9
Bump trim-newlines from 3.0.0 to 3.0.1
Bumps [trim-newlines](https://github.com/sindresorhus/trim-newlines) from 3.0.0 to 3.0.1.
- [Release notes](https://github.com/sindresorhus/trim-newlines/releases)
- [Commits](https://github.com/sindresorhus/trim-newlines/commits)

---
updated-dependencies:
- dependency-name: trim-newlines
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 08:11:20 +00:00
Jonas Jenwald
e7dc822e74
Merge pull request #12726 from brendandahl/standard-fonts
[api-minor] Include and use the 14 standard font files.
2021-06-08 10:09:40 +02:00
Brendan Dahl
4c1dd47e65 Include and use the 14 standard fonts files. 2021-06-07 11:10:11 -07:00
calixteman
8b4acb4e36
Merge pull request #13501 from calixteman/13500
XFA - CDATA can be xml so parse it when required
2021-06-07 11:27:49 +02:00
Jonas Jenwald
e0abf87bc3
Merge pull request #13505 from Snuffleupagus/createMatrix-DOMSVGFactory
Use the `DOMSVGFactory`, rather than manually creating the SVG-element, in `createMatrix` (PR 13361 follow-up)
2021-06-07 11:16:07 +02:00
Calixte Denizet
5dc7f4ade8 XFA - CDATA can be xml so parse it when required 2021-06-07 10:38:39 +02:00
calixteman
1775d5eeb7
Merge pull request #13503 from calixteman/nodata
XFA - Don't bind a form node with an empty value when the data node doesn't exist
2021-06-07 10:37:14 +02:00
Jonas Jenwald
9e632ee323 Use the DOMSVGFactory, rather than manually creating the SVG-element, in createMatrix (PR 13361 follow-up)
Generally, in the `src/display/` folder, we utilize `DOMSVGFactory` rather than manually creating an SVG-element; hence let's do the same thing in `src/display/pattern_helper.js` as well.
2021-06-07 10:15:20 +02:00
Calixte Denizet
112645ea3d XFA - Don't bind a form node with an empty value when the data node doesn't exist 2021-06-06 17:59:01 +02:00
Tim van der Meij
2b63d97b9d
Merge pull request #13461 from Snuffleupagus/issue-6605
Improve text-selection for Type3 fonts with empty /FontBBox-entries (issue 6605)
2021-06-06 14:37:52 +02:00
Tim van der Meij
7d834396e4
Merge pull request #13498 from Snuffleupagus/issue-12996
Normalize the coordinates used in `SVGGraphics._makeTilingPattern` (issue 12996)
2021-06-06 14:31:35 +02:00
Jonas Jenwald
04ab4bd406 Normalize the coordinates used in SVGGraphics._makeTilingPattern (issue 12996)
While this prevents the error which is currently thrown by the `assert` in the `DOMSVGFactory.create` method, the pattern still doesn't actually render (visibly). However, in the interest of getting rid of some open issues, this patch should make (some) sense and there's already other issues about patterns in the SVG-backend,

Given that, as clearly [outlined in the FAQ](https://github.com/mozilla/pdf.js/wiki/Frequently-Asked-Questions#backends), the SVG-backend is *not* officially supported and that there's currently no development of it; this is probably the most that is reasonable to do here.
2021-06-05 09:15:23 +02:00
Jonas Jenwald
1dd01b8506
Merge pull request #13494 from brendandahl/stepper-show-text
Add more info for showText operator in stepper.
2021-06-05 08:37:11 +02:00
Jonas Jenwald
eefc94ceb7 Ensure that we fully load Type3 fonts in PartialEvaluator.getTextContent
This is necessary now, since with the previous patch the /FontBBox potentially depends on the contents of the /CharProcs-streams.
Note that if `getOperatorList` is called *before* `getTextContent`, this patch doesn't matter since the font is already fully loaded/parsed. However, for e.g. the `text` test-cases this is necessary to ensure correct reference images.
2021-06-05 08:09:29 +02:00
Jonas Jenwald
20770cb06a Improve text-selection for Type3 fonts with empty /FontBBox-entries (issue 6605)
For Type3 fonts where the /CharProcs-streams of the individual glyph starts with a `d1` operator, we can use that to build a fallback bounding box for the font and thus improve text-selection in some cases.
2021-06-05 08:09:29 +02:00
Brendan Dahl
6255c2a8f3
Merge pull request #13376 from calixteman/6132
Replace command with not enough args by an endchar in CFF font
2021-06-04 14:00:51 -07:00
Brendan Dahl
17f1857556 Add more info for showText operator in stepper.
Adds a table that shows original char code, font char code, and unicode.
2021-06-04 13:58:05 -07:00
Tim van der Meij
eba6db9dc6
Merge pull request #13497 from Snuffleupagus/HTMLResult-lazy
Initialize `HTMLResult.{FAILURE, EMPTY}` lazily
2021-06-04 21:24:49 +02:00
Tim van der Meij
ce1ed60d11
Merge pull request #13490 from Snuffleupagus/issue-10362
Miscellaneous improvements for `gulpfile.js` (issue 10362)
2021-06-04 21:13:06 +02:00
Jonas Jenwald
75113e4517 Initialize HTMLResult.{FAILURE, EMPTY} lazily
While these objects aren't exactly that big and/or complex, they are nonetheless *only* necessary for XFA documents.
However, currently these objects are initialized *eagerly* for all PDF documents. By using the same pattern as elsewhere in the code-base, it's very easy to make these lazily initialized; so let's just do that instead :-)
2021-06-04 21:01:14 +02:00
Tim van der Meij
ed0990ab6f
Merge pull request #13492 from MMeent/patch-1
Add normalization for Hyphen -> Hyphen-minus
2021-06-04 21:00:02 +02:00
calixteman
e0676ec298
Merge pull request #13473 from calixteman/usehref
XFA - Implement usehref support
2021-06-04 20:13:22 +02:00
Brendan Dahl
425e58431a
Merge pull request #13482 from Snuffleupagus/scrollMatches-fix
Fix scrolling of search results in documents with marked content (bug 1714183)
2021-06-04 10:16:05 -07:00
Jonas Jenwald
66a5671847 Remove gulp makefile, since it's broken and unused
Looking at the history of the code, this `gulp` task was *accidentally* broken in the Gulp 4 upgrade in PR 10266 (all the way back in 2018).
Given that no one has either noticed and/or complained about this since, it's safe to assume that it's completely unused, hence why I suggest that we just remove this `gulp` task (rather than fixing it).
2021-06-04 17:55:35 +02:00
MMeent
3631121841
Add normalization for Hyphen -> Hyphen-minus
Previously these two characters were not searchable interchangably, even when Hyphen-Minus is being changed to Hyphen in some text to PDF pipelines.
2021-06-04 15:54:52 +02:00
Calixte Denizet
11573ddd16 XFA - Implement usehref support
- attribute 'use' was already implemented but not usehref
  - in general, usehref should make reference to current document
  - add support for SOM expressions in use and usehref to search a node.
  - get prototype for all nodes if any.
2021-06-04 14:57:05 +02:00
Jonas Jenwald
3b502f7e07
Merge pull request #13478 from brendandahl/find-regression
Fix find highlighting regression from #13306.
2021-06-04 14:09:35 +02:00
Jonas Jenwald
6c249f8e21 Clean-up gulpfile.js by removing most "-pre" tasks (issue 10362)
Most of the `gulp` tasks with a "-pre" suffix, especially those related to the main build-targets, are no longer needed and can simply be inlined in their corresponding tasks. This is likely a left-over from older Gulp-versions, but currently it only adds unnecessary indirection.

Furthermore, a number of the `gulp` tasks which are only used *internally* are converted to standard functions instead. This prevents them from being exposed "globally" and e.g. listed by `gulp default`.
2021-06-04 13:28:58 +02:00
Jonas Jenwald
92434b1eb4 Replace anonymous functions in gulpfile.js with named functions (issue 10362)
This replaces all of the `Starting '<anonymous>'...` lines in the output, when running various `gulp` tasks, with more meaningful function names.
2021-06-04 13:09:03 +02:00
Jonas Jenwald
ed9d5c4ec2
Merge pull request #13489 from Snuffleupagus/hasEOL-TextItem-docs
Add `hasEOL` to the `TextItem` typedef in the API (PR 13257 follow-up)
2021-06-04 11:16:43 +02:00
Jonas Jenwald
4b1c4d2bd9 Add hasEOL to the TextItem typedef in the API (PR 13257 follow-up) 2021-06-04 10:22:43 +02:00
Jonas Jenwald
29e6930bb6 Fix scrolling of search results in documents with marked content (bug 1714183)
This regressed in PR 13171, since the `span`s with the marked content identifiers interfere with scrolling of search results.
2021-06-03 12:41:51 +02:00
Jonas Jenwald
2a35b39c46 Remove the unused dataset checks from the scrollIntoView helper function
This code was added in PR 3968, apparently in order to fix scrolling of search results in HiDPI-mode.
However, after PR 4570 nothing is setting these `dataset`-properties any more and this is thus dead code which should be removed. (If that change had broken scrolling of search results in HiDPI-mode, you'd really expect that it'd been reported and fixed a long time ago.)
2021-06-03 11:43:38 +02:00
Jonas Jenwald
9165dc0659
Merge pull request #13480 from Snuffleupagus/generic-viewer-print
[GENERIC viewer] Fix printing regression from PR 13411
2021-06-02 22:34:15 +02:00
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