12 Commits

Author SHA1 Message Date
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
Libor M.
22b826dc81
Merge pull request #1411 from chooblarin/doc-fix
Fix doc about creation of pdf document
2024-10-30 13:41:16 +01:00
Andrei Augustin
92c593f208 Added note to docs regarding PDF/A not supporting the standard AFM fonts 2023-07-13 10:52:07 +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
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
Sota Hatakeyama
e48002df75 Fix doc about creation of pdf document 2022-12-23 13:12:02 +09:00
César Guadarrama
9c71eb8c03
Update getting_started.md
Remove unexpected semicolon
2022-03-09 00:29:01 -06:00
Libor M
4863560826 fix paper sizes page 2019-04-30 15:28:13 +02:00
Luiz Américo
e2c9459d94 Add changelog and improve Get Started document 2019-03-02 21:30:20 -03:00
Luiz Américo
a8f796b97b Add documentation for default font option 2019-03-02 20:54:34 -03:00
Devon Govett
64d2fb86d4 A few docs fixes 2019-01-27 19:29:58 -08:00
Luiz Américo
aec971f2c8 Rename docs files, removing the coffee sufix 2018-12-19 20:34:40 -03:00