831 Commits

Author SHA1 Message Date
ajaykrdas
5505b6db87
Accessibility Issue: CS / cs Operator Error in Tagged Table (#1666)
* Accessibility Issue: CS / cs Operator Error in Tagged Table #1640

* Fix Table Accessibility Issue: Operator CS/cs not allowed in this current state

* revert modifications at debug line
2025-12-22 14:54:06 -03:00
Adrian Kowalczewski
0b01ef4146
Accessibility: Fixed Link annotation is not nested inside a Link structure element (#1664)
* Accessibility: Fixed Link annotation is not nested inside a Link structure element

* Accessibility: Fixed Link annotation is not nested inside a Link structure element

* Changelog

* Fix links leakage into subsequent structures

* Prettier

---------

Co-authored-by: akowalczewski <akowalczewski@gn.com>
2025-12-18 10:53:27 -03:00
markbruce
d0108157f1
fix: use dynamic count for beginbfrange declaration (#1660)
* fix: use dynamic count for beginbfrange declaration

Fixes garbled text copying in Chrome/Edge for PDFs with >256 unique characters

* Add changelog line

Addressed an issue with garbled text copying in Chrome/Edge for PDFs containing more than 256 unique characters.

* test: add tests for beginbfrange count declaration

Add test cases to verify that the beginbfrange count declaration
in ToUnicode CMap matches the actual number of bfrange entries.

- Test for fonts with >256 characters (multiple ranges)
- Test for fonts with <=256 characters (single range)

These tests ensure the fix for the beginbfrange count bug is
correct and prevent regression.

Related to #1659

* Revert "test: add tests for beginbfrange count declaration"

This reverts commit dda6f4a762acbaa09f5986502c494c97959c7643.

* Rewrite tests for beginbfrange count declaraton. Fix code style issue.

* fix(tests): remove unused variables in font.spec.js

Replace for loops with unused match variables with spread operator
to directly get array length, fixing ESLint no-unused-vars errors.

- Replace loop counting with [...rangeMatches].length
- Fixes ESLint errors at lines 152 and 197 in tests/unit/font.spec.js
- All tests pass successfully

---------

Co-authored-by: zhang_xiaoning <zxn@winning.com.cn>
2025-11-30 21:52:23 -03:00
Luiz
070f275a54 Add transparent (palette) 1 bit png for testing 2025-11-01 14:59:08 -03:00
Luiz
cbf57a412c Update yarn and canvas dependencies 2025-11-01 13:47:36 -03:00
Luiz Américo Pereira Câmara
419d3f0c05 Improve test configuration 2025-09-02 11:58:23 -03:00
Luiz Américo Pereira Câmara
fc0d276e0d v0.17.2 2025-08-30 15:15:29 -03:00
Luiz Américo Pereira Câmara
12439175d7 Code cleanup in text.js 2025-08-30 15:13:31 -03:00
Luiz Américo Pereira Câmara
60cd4b65e1 Fix unbalanced sectionStart/End events when text starts a new page - #1596 2025-08-30 14:44:49 -03:00
Luiz Américo Pereira Câmara
726dfdc9e1 Improve jest matchers 2025-08-30 14:41:31 -03:00
Luiz Américo Pereira Câmara
d837a13569 v0.17.1 v0.17.1 v0.17.2 2025-05-03 00:53:13 -03:00
Luiz Américo Pereira Câmara
4b2030eedd Streamline AFMFont parsing. Do not keep contents in memory 2025-05-03 00:12:01 -03:00
Luiz Américo Pereira Câmara
715c2e39aa Remove AFMFont.charWidths 2025-05-03 00:03:33 -03:00
Luiz Américo Pereira Câmara
194f2eff65 Remove AFMFont.open 2025-05-03 00:02:54 -03:00
Luiz Américo Pereira Câmara
f4edf3d405 Do not assign match variable on condition check 2025-05-02 23:20:21 -03:00
Jake Holland
54e6600f1c
Fix precision rounding issues in LineWrapper (#1595)
* Fix further LineWrapper precision issues

* add test of bounded text precision issue

* add rowSpanning table example

* add failure threshold

* implement toContainText jest matcher

* create a unit test for bounded text precision

* remove round up rounding code path

---------

Co-authored-by: Luiz Américo Pereira Câmara <blikblum@users.noreply.github.com>
2025-05-02 23:05:11 -03:00
chronospatian
f3c1776850
Fix table with null text (#1609)
* Handle null values in table text

* Add test case for null value in table text

* Update CHANGELOG.md
2025-04-17 06:18:58 -03:00
Libor M.
e016c22291 update canvas 2025-04-16 16:40:29 +02:00
Libor M.
38fa457118 Update .npmignore 2025-04-16 16:40:11 +02:00
Libor M.
a05373f81f guide 0.17.0 2025-04-16 16:36:53 +02:00
Luiz Américo Pereira Câmara
c81e3e6e36 v0.17.0 v0.17.0 2025-04-12 17:07:41 -03:00
Luiz Américo Pereira Câmara
83e6248168 Add .git-blame-ignore-revs 2025-04-12 13:09:46 -03:00
Luiz Américo Pereira Câmara
a76ab284a8 Apply prettier formatting 2025-04-12 12:57:31 -03:00
Luiz Américo Pereira Câmara
8b087cee41 Improve prettier configuration 2025-04-12 12:54:07 -03:00
Luiz Américo Pereira Câmara
15087ea8c3 Cleanup / simplify code 2025-04-12 12:43:17 -03:00
Luiz Américo Pereira Câmara
c5606d40e7 Fix updating y position when adding a image 2025-04-12 10:34:43 -03:00
Jake Holland
033ba3426b
Add support for tables (#1577)
* Add page size utilities

- Added page.contentWidth
- Added page.contentHeight

* Add table support

- Tables support cell customization (including colors)
- Tables also support rotatable text (with alignment support)
- Tables have accessibility support

* chore: fix code generation context

- code generation now respects the current document positioning to allow use of page dependent operations

* chore: remove comments from build

* removed unnecessary config optimisations

* Optimize table minification

* Performance improvements to tables

* Improve font handling in tables
2025-02-24 07:49:25 -03:00
Jake Holland
ee7208b4ea
Fix page cascade options when text overflows (#1597) 2025-02-05 07:49:58 -03:00
Jake Holland
868e9be3c4
Fix text overflow issues in boundsOfString (#1594) 2025-01-27 16:45:20 -03:00
Libor M.
1abb3541e0 Fix fonts without a postscriptName #1590 2025-01-18 14:54:10 +01:00
Jake Holland
f4466085d3
Enable rotatable text (#1589) 2025-01-15 14:06:15 +01:00
Libor M.
6603d6ae76 restore .prettierrc 2025-01-14 15:38:54 +01:00
Jake Holland
73d86db95e
Fix side normalize when non-object (#1585) 2025-01-13 13:04:06 +01:00
Jake Holland
36549b3946
Add support for dynamic sizing (#1576)
* Add support for dynamic sizing

- Enable defining sizes using any units (defaulting to Points)
- This also allows us to define sizes based on the current font context i.e. em's
- The new public `sizeToPoint` method allows users to also interact with these sizes to generate the correct point sizes

* Optimise side normalization

* Added test case for one margin being undefined
2025-01-12 18:17:13 -03:00
Benno L
52ed58ef74
Documentation of text option 'features' missed passing an object to deactivate default font features (#1581)
* fixed text features documentation, added note about deactivating default features

* made documentation more precise
2025-01-11 13:36:10 +01:00
Jake Holland
40a0f383a7
Fix precision rounding issues in LineWrapper (#1583)
Handle JS quirks with large decimal precision checks resulting from the calculations of next lines in the LineWrapper
2025-01-11 13:16:17 +01:00
Libor M.
25111224f3 0.16.0 v0.16.0 2024-12-29 10:44:52 +01:00
Libor M.
928511d189 fix docs 2024-12-29 10:35:21 +01:00
Libor M.
2d2790f84f fix ignores 2024-12-29 09:43:49 +01:00
Libor M.
bbe4ab9305 Add Name property for set custom icon for note() #1319 2024-12-28 16:00:38 +01:00
Libor M.
cf5a77469f Fix for embedding fonts into PDF (font name must not contain spaces) #1314 2024-12-28 14:05:02 +01:00
Libor M.
704a005ac2 Fix font cache collision identical metadata for different fonts #1330 2024-12-28 13:34:00 +01:00
Kevin Hendel
1b678c3e3d
Indent after linebreak (#879)
* add indentAllLines option to indent all lines of a paragraph instead of only the first one

* update comments

* Update CHANGELOG.md

---------

Co-authored-by: Libor M. <liborm85@gmail.com>
2024-12-27 15:52:48 +01:00
Libor M.
133a321a56 Add support to scale text horizontally
inspired by #445
2024-12-27 15:34:22 +01:00
Libor M.
42172c5102 Fix font cache collision for fonts with missing postscript name or bad TTF metadata #1384 #691 2024-12-27 12:07:52 +01:00
Adrian Rollett
8b20d0742a
Fix sets tab order to "Structure" when a document is tagged #1260 (#1449)
* Set tab order when document is tagged

* Update approach and add inverse test

* Revert page dictionary setup

* Update lib/mixins/markings.js

* Update kitchen-sink-accessible.pdf

* Update CHANGELOG.md

---------

Co-authored-by: Libor M. <liborm85@gmail.com>
2024-12-26 14:35:14 +01:00
Libor M.
baeff0fa85
Update color.spec.js 2024-12-26 14:28:38 +01:00
Libor M.
6cb610cce3 fix lint issue 2024-12-26 13:12:45 +01:00
Libor M.
3ccf3b8d90 Add support for spot colors #756 2024-12-26 13:11:07 +01:00
Benjamin Bloomfield
eecfb4c97a
Fix measuring text when OpenType features are passed in to .text() (#1492)
* Update text.js

to fix measuring text when opentype features are passed in to .text()

* added simple test

* Update CHANGELOG.md

---------

Co-authored-by: Libor M. <liborm85@gmail.com>
2024-12-25 07:45:56 +01:00