369 Commits

Author SHA1 Message Date
Andrei Augustin
408dc4e9ba
Add PDF/UA subset (#1485)
* Added PDF/UA subset and its metadata

* Added PDF/UA metadata unit tests

* Added PDF/UA subset to accessibility docs

* Updated change log for PDF/UA subset
2023-12-17 16:11:46 -03:00
Luiz Américo
5bbd9a18cb
Support Jpeg Exif Orientation (#1482)
Co-authored-by: Franklin Strube <fstrube@morevang.com>
Co-authored-by: Luiz Américo Pereira Câmara <blikblum@users.noreply.github.com>
2023-12-03 07:48:00 -03:00
Andrei Augustin
c1d7700421
Support for PDF/A-2 and PDF/A-3 subsets (#1432)
* Added PDF/A-2 and PDF/A-3 subsets A and B

It seems like PDF/A-2 and PDF/A-3 are not very different from PDF/A-1 as far as the A and B subsets are concerned (A requires tagging which PDFKit supports already). With this change, we can let the generated PDF present itself as PDF/A-2 or PDF/A-3.

* Updated docs and changelog for new PDF/A subsets

* Fixed an issue where ICC profile path can be wrong for built package but good for tests
2023-03-09 08:00:08 -03:00
Andrei Augustin
ba4e7cb698
Fixed lint's unnecessary semicolon error (#1414)
* Fixed lint's unnecessary semicolon error

* Fixed pdfa1 colour profile test error

The directory where the colour profile is stored was changed, but the test was not updated.
2023-03-05 15:25:01 -03:00
Andrei Augustin
3904188903
Initial support for PDF/A-1a/b (#1395)
* pdf/a1b support initial commit

Added mixin for support pdf/a1b and a few of the things it requires (xmp metadata, colour profile). Currently, the CIDSet stream is the only error it comes back with the test case I'm using, will try sorting it out next.

* Adding CIDSet when generating PDF/A

PDF/A1 b/a requires a CIDSet. This is not checked by a validator and other converters seem to add a CIDSet with a value of FF FF FF FF 0C, so this commit does the same. When extending support for PDF/A 2/3/4, we may not add a CIDSet (I think for PDF/A3 it's not required?) or we will look for a proper way to generate the CIDSet.

At this point, PDFKit should be able to generate PDF/A1b which can pass veraPDF validation and PDF/A1a if tagged is enabled.

All you have to do is set pdfa: '1a' or pdfa: '1b' in the options passed to new PDFDocument.

* pdf/a intro docs

* generalising subsets, reimplementing pdfa1 and added control over metadata

added a generalised subsets mixin which can pull in a subset at runtime.
reimplemented pdfa1 mixin as some features should be standardised across all subsets, such as storing /Info as xmp metadata for pdf >1.3
added a metadata class and mixing to control and write the metadata to a pdf

* added tests for pdfa1 and metadata and moved joinTokens in helpers

Addeds tests for pdfa1 subset and metadata.
Moved joinTokens into helpers.js as it's now used in at least two places.
Added tests for document to when metadata should be added (pdf version 1.4 or newer) and when it shouldn't (pdf version 1.3)

* updated pdf/a docs to reflect latest changes

* store color profile as icc file

* Updated changelog to include PDF/A support in Unreleased section
2023-01-06 19:25:11 -03:00
Jernej Logar
4c5e73a06c
Tiling pattern support (#526) (#1311)
* tiling pattern support (foliojs#526)

based on strokovnjaka/pdfkit@b85dd55622

Co-authored-by: Jernej Logar <jernej.logar@plandela.si>
2021-10-24 07:50:52 -03:00
David Lilue
a41f33886f
Refactor on equality check function (#1280)
Avoidable 'if' statement
2021-07-13 18:52:41 -03:00
adrift2000
4700537d82
Fix for PDF accessibility check. (#1265) 2021-06-22 12:48:53 -03:00
Simon Osterlehner
131df9e0ae
Add option to define AcroForm fontSize. Fixes #1088 2021-05-29 18:12:36 -03:00
Subhi Al Hasan
6338314daf
Allow applying 'underline' and 'strike' text styling together on a text (#1253)
Co-authored-by: Subhi Al Hasan <subhi.al.hasan@freiheit.com>
2021-05-28 13:51:12 -03:00
Luiz Américo Pereira Câmara
1d5c905ba0 Use crypto-js instead of crypto in attachments 2021-03-28 09:54:40 -03:00
Steffen Matheis
3cd88b296c rename fileAttachmentAnnotation to fileAnnotation 2021-03-25 15:13:58 -03:00
Steffen Matheis
7219fd07a9 add support for embedded files and file attachment annotations 2021-03-25 15:13:58 -03:00
Jakub Valenta
63972499c0 lib/font/embedded: Don't put '@' in font tag
Otherwise Adobe Illustrator says "This document uses fonts that are
currently not available on your computer".
2021-03-24 15:25:51 -03:00
Ben Schmidt
923c495022 Correct marking bug and improve demo accessibility. 2021-01-15 16:43:49 -03:00
Ben Schmidt
e3fa4f7c7b Remove accidental tabs. 2021-01-15 16:43:49 -03:00
Ben Schmidt
e3442a9aa2 Add shortcut for elements containing only marked content. 2021-01-15 16:43:49 -03:00
Ben Schmidt
4c4a49ebff Guard against adding a structure element to more than one parent. 2021-01-15 16:43:49 -03:00
Ben Schmidt
2ed3782473 Guard against invalid structure element children. 2021-01-15 16:43:49 -03:00
Ben Schmidt
057215fc8f Guard against adding children to ended structure elements. 2021-01-15 16:43:49 -03:00
Ben Schmidt
9c0aaec172 Remove unnecessary constructors. 2021-01-15 16:43:49 -03:00
Ben Schmidt
d565f862c0 Fix linter warnings. 2021-01-15 16:43:49 -03:00
Ben Schmidt
c2ec121ab8 Support automatic marking and structure construction for text. 2021-01-15 16:43:49 -03:00
Ben Schmidt
9b3aa7b50a Fully support PDF/UA. 2021-01-15 16:43:49 -03:00
Ben Schmidt
272444e397 Fully support accessibility features from PDF reference. 2021-01-15 16:43:49 -03:00
Ben Schmidt
c177874e82 Fully support Tagged PDF. 2021-01-15 16:43:49 -03:00
Ben Schmidt
bc09c32d1b Support marked structure content and logical structure. 2021-01-15 16:43:49 -03:00
Ben Schmidt
43128adbb3 Add number tree. 2021-01-15 16:43:49 -03:00
Ben Schmidt
ef5e52b2ad Support marking content. 2021-01-15 16:43:49 -03:00
Luiz Américo
326350b7f9 Fix eslint and prettier warnings 2020-09-09 20:35:10 -03:00
Libor M
ba62aeff11 fix Buffer() is deprecation warning #1114 2020-07-25 11:25:56 +02:00
Rocco Bruyn
812a6db941 Pass 'encoding' param of VFS' readFileSync to 'toString'
Fixes #1133
2020-07-19 16:53:45 +02:00
adrift2000
d520bf2e02
Update security.js
Access permissions are not applied to PDF if pdfVersion is "1.7ext3".
2020-07-02 11:51:33 +10:00
freund17
df33cbcbe3
Added valueOf() to generateFileID
Fixes https://github.com/foliojs/pdfkit/issues/1110
2020-05-19 16:13:27 +02:00
Nathanael Anderson
db6a8117d2 Expose LineWrapper class 2020-04-08 11:27:17 -05:00
Jim Pravetz
e2a464c1dc Merge branch 'master' of https://github.com/foliojs/pdfkit
# Conflicts:
#	lib/mixins/annotations.js
2019-12-02 11:09:47 -08:00
Devon Govett
9fbd52e033
Merge branch 'master' into support-png-interlaced 2019-11-16 19:26:51 -08:00
Luiz Américo
a7116f244c Pass number function directly to map 2019-11-15 22:59:00 -03:00
Luiz Américo
4d8de9164c Fix gradient with multiple stops (#1045) 2019-11-15 22:56:10 -03:00
Luiz Américo
44e265bc2a
Merge pull request #1023 from URSELF-FR/master
Fix infinite loop when lineWidth is smaller than width of a character
2019-11-14 12:52:14 -03:00
VincentGuinaudeau
acf318b87c comments, test and changelog entry for fix when a character is too bigger than the width of the text. 2019-11-14 12:08:04 +01:00
Luiz Américo
51d4fdd0a3
Merge pull request #1020 from padraiggalvin/link-annotation-flag
Set link annotation flag to print by default
2019-11-13 19:32:04 -03:00
Luiz Américo
30ec8b0c30 png: use predictor 1 (none) for interlaced images 2019-09-29 00:03:07 -03:00
Luiz Américo
c658bef0cc png: decode pixels when image is interlaced 2019-09-28 21:26:11 -03:00
Luiz Américo
50dbed9401 Remove redundant value existence checks 2019-09-28 21:21:30 -03:00
VincentGuinaudeau
17e08a66dd Fix infinite loop when lineWidth is smaller than width of a character. Not sure about what to do in this case yet. 2019-09-11 14:57:51 +02:00
Pádraig Galvin
058f6fa5e7 Fix typo in comment 2019-09-06 18:54:41 +02:00
Pádraig Galvin
f6cd98666e Set link annotation flag to print 2019-09-05 16:41:00 +02:00
Pádraig Galvin
068e9afe05 Explicitly define default value for CIDToGIDMap 2019-09-04 15:04:27 +02:00
Paul Winkler
b410466068
enable removing link annotation in continued text
Text options currently add a link annotation unless the link is `undefined` or `null`. When the text options are built using the continued flag any value that is `null` or `undefined` is overridden by the continued options. As `0` is used for a first page link, it should be allowed to specify `false` to stop continued text being a link.
2019-09-02 16:45:58 +01:00