Skip to content

Commit 2c8df69

Browse files
committed
fix: documentation and misspelling errors
1 parent a44db8b commit 2c8df69

40 files changed

Lines changed: 396 additions & 344 deletions

README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
[![Sponsor on GitHub](https://img.shields.io/badge/sponsor-github-EA4AAA.svg?logo=githubsponsors&logoColor=white)](https://github.com/sponsors/tecnickcom)
1414

15-
> 💖 **Keep TCPDF maintained.** `tc-lib-pdf` is the actively-developed successor to **TCPDF**, which is installed 100M+ times across 500+ PHP packages and is now maintenance-only. If your company depends on it, [become a sponsor](https://github.com/sponsors/tecnickcom) to keep this shared infrastructure secure and maintained — see [Sponsors](#sponsors) for tiers.
15+
> 💖 **Keep TCPDF maintained.** `tc-lib-pdf` is the actively-developed successor to **TCPDF**, which is installed 100M+ times across 500+ PHP packages and is now maintenance-only. If your company depends on it, [become a sponsor](https://github.com/sponsors/tecnickcom) to keep this shared infrastructure secure and maintained. See [Sponsors](#sponsors) for tiers.
1616
1717
---
1818

@@ -49,20 +49,20 @@ It coordinates specialized companion packages for fonts, images, graphics, pages
4949

5050
Releases follow [Semantic Versioning](https://semver.org):
5151

52-
- **PATCH** backwards-compatible bug fixes
53-
- **MINOR** backwards-compatible new features
54-
- **MAJOR** breaking changes
52+
- **PATCH**: backwards-compatible bug fixes
53+
- **MINOR**: backwards-compatible new features
54+
- **MAJOR**: breaking changes
5555

5656
---
5757

5858
## Sponsors
5959

60-
`tc-lib-pdf` is the actively-developed successor to **TCPDF**, which is installed **100M+ times across 500+ PHP packages** and is now maintenance-only. If your product relies on TCPDF or `tc-lib-pdf`, sponsoring is how that shared infrastructure stays secure and maintained closer to insurance on a dependency you already ship than to a donation.
60+
`tc-lib-pdf` is the actively-developed successor to **TCPDF**, which is installed **100M+ times across 500+ PHP packages** and is now maintenance-only. If your product relies on TCPDF or `tc-lib-pdf`, sponsoring is how that shared infrastructure stays secure and maintained, closer to insurance on a dependency you already ship than to a donation.
6161

6262
[![Sponsor on GitHub](https://img.shields.io/badge/sponsor-github-EA4AAA.svg?logo=githubsponsors&logoColor=white)](https://github.com/sponsors/tecnickcom)
6363

6464
<!-- sponsors -->
65-
**Your logo here.** Be the first company to back the project [become a sponsor →](https://github.com/sponsors/tecnickcom)
65+
**Your logo here.** Be the first company to back the project: [become a sponsor →](https://github.com/sponsors/tecnickcom)
6666
<!-- sponsors -->
6767

6868
See **[SPONSORS.md](https://github.com/tecnickcom/.github/blob/main/SPONSORS.md)** for sponsorship tiers, how to add your logo, and the logo/content policy. Individual backers are listed in **[BACKERS.md](https://github.com/tecnickcom/.github/blob/main/BACKERS.md)**.
@@ -99,7 +99,7 @@ The fastest way to evaluate the library is to follow the installation and quick-
9999
- Bookmarks, named destinations, and table of contents
100100
- Automatic page numbering and page groups
101101
- Full page box control (Media/Crop/Bleed/Trim/Art), page reordering, and viewer preferences
102-
- **Per-page transparency group control** via `setPageTransparencyGroup()` by default (`'auto'`) the page transparency `/Group` is emitted only on pages that actually blend, flattening fully-opaque pages for faster, more predictable printing on conservative RIPs/firmware; `'always'` keeps the group on every page (legacy) and `'never'` drops it entirely
102+
- **Per-page transparency group control** via `setPageTransparencyGroup()`: by default (`'auto'`) the page transparency `/Group` is emitted only on pages that actually blend, flattening fully-opaque pages for faster, more predictable printing on conservative RIPs/firmware; `'always'` keeps the group on every page (legacy) and `'never'` drops it entirely
103103

104104
### Images & Graphics
105105
- Native **JPEG**, **PNG**, and **SVG** support
@@ -111,19 +111,19 @@ The fastest way to evaluate the library is to follow the installation and quick-
111111
### Security & Standards
112112
- Password and certificate-based document encryption (RC4 and AES, up to 256-bit)
113113
- Remote resource controls via `fileOptions` with host allowlists plus separate internal and markup local-path allowlists for external assets
114-
- **Digital signatures** detached CMS (PKCS#7) and **PAdES baseline** signatures (ETSI EN 319 142-1) via the fluent `signature()` facade, with configurable appearance fields. Profiles: `legacy` (ISO 32000-1 `adbe.pkcs7.detached`), `pades-b-b`, `pades-b-t`, `pades-b-lt`, and `pades-b-lta` (`ETSI.CAdES.detached`), with RSA or ECDSA keys and `sha256`/`sha384`/`sha512` digests. Both local (private-key) and external/remote (HSM) signing are supported. The cryptography lives in the companion package [`tc-lib-pdf-sign`](https://github.com/tecnickcom/tc-lib-pdf-sign); see [doc/DIGITAL_SIGNATURES.md](doc/DIGITAL_SIGNATURES.md)
115-
- **RFC 3161 TSA timestamps** (PAdES B-T) embed a trusted timestamp token from any RFC 3161-compliant Time Stamping Authority (TSA) into the CMS signature as the `id-aa-signatureTimeStampToken` attribute; configurable digest algorithm (`sha256`, `sha384`, `sha512`), policy OID, nonce, timeout, and TLS peer verification
116-
- **LTV (Long-Term Validation)** (PAdES B-LT) embed revocation evidence in a post-signing incremental revision:
114+
- **Digital signatures**: detached CMS (PKCS#7) and **PAdES baseline** signatures (ETSI EN 319 142-1) via the fluent `signature()` facade, with configurable appearance fields. Profiles: `legacy` (ISO 32000-1 `adbe.pkcs7.detached`), `pades-b-b`, `pades-b-t`, `pades-b-lt`, and `pades-b-lta` (`ETSI.CAdES.detached`), with RSA or ECDSA keys and `sha256`/`sha384`/`sha512` digests. Both local (private-key) and external/remote (HSM) signing are supported. The cryptography lives in the companion package [`tc-lib-pdf-sign`](https://github.com/tecnickcom/tc-lib-pdf-sign); see [doc/DIGITAL_SIGNATURES.md](doc/DIGITAL_SIGNATURES.md)
115+
- **RFC 3161 TSA timestamps** (PAdES B-T): embed a trusted timestamp token from any RFC 3161-compliant Time Stamping Authority (TSA) into the CMS signature as the `id-aa-signatureTimeStampToken` attribute; configurable digest algorithm (`sha256`, `sha384`, `sha512`), policy OID, nonce, timeout, and TLS peer verification
116+
- **LTV (Long-Term Validation)** (PAdES B-LT): embed revocation evidence in a post-signing incremental revision:
117117
- collects the signing certificate chain and fetches OCSP responses and/or CRL payloads from AIA and CDP URLs
118118
- deduplicates binary payloads by fingerprint
119119
- emits a Document Security Store (`/DSS`) carrying `/VRI`, `/Certs`, `/OCSPs`, and `/CRLs`, referenced from the re-emitted document catalog
120120
- each feature (OCSP, CRL, cert embedding, DSS, VRI) can be enabled independently via the `signature()` LTV options
121-
- **Archive timestamps** (PAdES B-LTA) add a `/Type /DocTimeStamp` archive timestamp over the whole document in a further incremental revision via `signature()->upgradeToLta()`
121+
- **Archive timestamps** (PAdES B-LTA): add a `/Type /DocTimeStamp` archive timestamp over the whole document in a further incremental revision via `signature()->upgradeToLta()`
122122
- **PDF annotations**: links, text notes, file attachments, markup, shapes, media, and widgets
123123
- **JavaScript** embedding
124-
- **PDF/A** (1/2/3, including a/b/u conformance levels) see [doc/STANDARDS.md](doc/STANDARDS.md) and [E001_invoice.php](examples/E001_invoice.php) for a Factur-X / ZUGFeRD example
125-
- **PDF/X** (generic alias, PDF/X-1a, PDF/X-3, PDF/X-4, PDF/X-5)print-exchange conformance: per-variant OutputIntent identifiers, GTS_PDFXVersion in Info dict and XMP, PDF version enforcement, CMYK color forcing for restrictive profiles (X-1a, X-3), transparency restrictions, and suppression of encryption and JavaScript
126-
- **PDF/UA** (generic alias, PDF/UA-1, PDF/UA-2)accessibility conformance: tagged structure tree (`StructTreeRoot` / `ParentTree`), `MarkInfo /Marked true`, document language (`/Lang`), `DisplayDocTitle true`, `ActualText` for ligatures and special glyphs, figure alt-text tagging, and heading-level clamping to prevent skipped levels; PDF/UA-2 targets PDF 2.0
124+
- **PDF/A** (1/2/3, including a/b/u conformance levels): see [doc/STANDARDS.md](doc/STANDARDS.md) and [E001_invoice.php](examples/E001_invoice.php) for a Factur-X / ZUGFeRD example
125+
- **PDF/X** (generic alias, PDF/X-1a, PDF/X-3, PDF/X-4, PDF/X-5): print-exchange conformance covering per-variant OutputIntent identifiers, GTS_PDFXVersion in Info dict and XMP, PDF version enforcement, CMYK color forcing for restrictive profiles (X-1a, X-3), transparency restrictions, and suppression of encryption and JavaScript
126+
- **PDF/UA** (generic alias, PDF/UA-1, PDF/UA-2): accessibility conformance covering tagged structure tree (`StructTreeRoot` / `ParentTree`), `MarkInfo /Marked true`, document language (`/Lang`), `DisplayDocTitle true`, `ActualText` for ligatures and special glyphs, figure alt-text tagging, and heading-level clamping to prevent skipped levels; PDF/UA-2 targets PDF 2.0
127127

128128
### PDF Import
129129
- Import pages from existing PDFs as **Form XObjects** and place them on any destination page
@@ -216,17 +216,17 @@ $pdf->renderPDF($rawpdf);
216216

217217
> **Note:** `realpath()` returns `false` when the fonts directory does not yet exist. If you see `K_PATH_FONTS` errors on first run, verify that fonts were generated after `composer install` (see [doc/FONTS.md](doc/FONTS.md)).
218218
219-
For more complete examples including invoices, images, barcodes, HTML tables, dedicated HTML selector/form/table showcases, PDF/X, and PDF/UA see the [examples](examples) directory.
219+
For more complete examples (including invoices, images, barcodes, HTML tables, dedicated HTML selector/form/table showcases, PDF/X, and PDF/UA), see the [examples](examples) directory.
220220
Annotation-focused runnable example: [examples/E027_annotations.php](examples/E027_annotations.php).
221221

222222
To run the bundled examples locally:
223223

224224
```bash
225-
make x # build example assets
225+
make fonts # generate the companion fonts used by the examples
226226
make server # start a local PHP server
227227
```
228228

229-
Then open <http://localhost:8971/index.php>.
229+
Then open <http://localhost:8971/E000_overview.php>.
230230

231231
If the minimal example fails on first run, verify these two points first:
232232

@@ -258,11 +258,11 @@ Selected topic groups in the examples set:
258258
To preview examples locally:
259259

260260
```bash
261-
make x
261+
make fonts
262262
make server
263263
```
264264

265-
Then open <http://localhost:8971/index.php>.
265+
Then open <http://localhost:8971/E000_overview.php>.
266266

267267
---
268268

doc/CACHE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Back to root overview: [README.md](../README.md#in-depth-documentation)
44

55
Generating font subsets and processing images (decode, resize, re-encode) is computationally expensive. `tc-lib-pdf` can reuse these results across `Tcpdf` instances and PHP processes through an **optional external cache** that you provide.
66

7-
No cache backend is shipped: you implement a tiny interface that bridges to whatever store you already use (filesystem, APCu, Redis, a PSR-16 cache, ...). Caching is **disabled by default** when no cache is supplied, behavior is unchanged.
7+
No cache backend is shipped: you implement a tiny interface that bridges to whatever store you already use (filesystem, APCu, Redis, a PSR-16 cache, ...). Caching is **disabled by default**: when no cache is supplied, behavior is unchanged.
88

99
One cache instance is reused by every cacheable subsystem (currently font subsets and images, more may be added later), so a single backend, connection, and configuration serves them all.
1010

@@ -63,8 +63,8 @@ $cache = new class implements CacheInterface {
6363

6464
| Subsystem | Type constant | Cached value | Key prefix |
6565
|-----------|---------------|--------------|------------|
66-
| Font subsets | `CacheInterface::TYPE_FONT` | Raw subset font program (`string`, uncompressed) | `tc-lib-pdf-font:subset:v1:` |
67-
| Images | `CacheInterface::TYPE_IMAGE` | Processed image snapshot (`array`) | `tc-lib-pdf-image:v1:` |
66+
| Font subsets | `CacheInterface::TYPE_FONT` | Raw subset font program (`string`, uncompressed) | `tc-lib-pdf-font:subset:v2:` |
67+
| Images | `CacheInterface::TYPE_IMAGE` | Processed image snapshot (`array`) | `tc-lib-pdf-image:v2:` |
6868

6969
Keys are already namespaced and schema-versioned by each sub-library, so a single shared store is collision-safe. The font subset cache is only consulted when font subsetting is enabled (`subsetfont: true`).
7070

@@ -86,7 +86,7 @@ interface SelectiveCacheInterface extends CacheInterface
8686

8787
When `supports()` returns `false` for a type, that type is disabled entirely: the cache is never queried or written for it, and your implementation never receives its data. A plain `CacheInterface` (without `supports()`) caches every type.
8888

89-
Example — cache font subsets but never images:
89+
For example, to cache font subsets but never images:
9090

9191
```php
9292
use Com\Tecnick\Pdf\Cache\CacheInterface;

doc/ICC_PROFILE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33
Back to root overview: [README.md](../README.md#in-depth-documentation)
44

5-
The bundled `sRGB.icc` profile is sourced from the Debian [`icc-profiles-free`](https://packages.debian.org/source/stable/icc-profiles-free) package.
5+
The bundled `sRGB.icc.z` profile (stored gzip-compressed) is sourced from the Debian [`icc-profiles-free`](https://packages.debian.org/source/stable/icc-profiles-free) package.

doc/STANDARDS.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@ PDF/A-3 supports embedding arbitrary file attachments (for example XML invoice p
3232
```php
3333
$pdf = new \Com\Tecnick\Pdf\Tcpdf(mode: 'pdfa3');
3434
// ... build document ...
35-
$pdf->Annotation(/* file attachment annotation pointing to the XML */);
35+
$pdf->addContentAsEmbeddedFile(
36+
file: 'factur-x.xml',
37+
content: $invoiceXML,
38+
mime: 'text/xml',
39+
afrel: \Com\Tecnick\Pdf\AFRelationship::Alternative,
40+
);
3641
$pdf->setCustomXMP('x:xmpmeta.rdf:RDF.rdf:Description.pdfaExtension:schemas.rdf:Bag', $xmpBag);
3742
```
3843

@@ -94,7 +99,7 @@ When a PDF/UA mode is active the library automatically:
9499
To provide the document language explicitly:
95100

96101
```php
97-
$pdf->setDocInfo(['a_meta_language' => 'de-DE']);
102+
$pdf->setLanguageArray(['a_meta_language' => 'de-DE']);
98103
```
99104

100105
To tag decorative or repeated content as Artifact (for example headers, footers, and page numbers):

examples/E057_multisignature_incremental.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,11 +211,11 @@
211211
]);
212212

213213
// Primary signature appearance – placed on page 2 at the first slot.
214-
$pdf->setSignatureAppearance(posx: 100, posy: 45, width: 90, heigth: 35, page: $page2['pid'], name: 'Author');
214+
$pdf->setSignatureAppearance(posx: 100, posy: 45, width: 90, height: 35, page: $page2['pid'], name: 'Author');
215215

216216
// Empty approval fields for the remaining approvers.
217-
$pdf->addEmptySignatureAppearance(posx: 100, posy: 90, width: 90, heigth: 35, page: $page2['pid'], name: 'Reviewer');
218-
$pdf->addEmptySignatureAppearance(posx: 100, posy: 135, width: 90, heigth: 35, page: $page2['pid'], name: 'Manager');
217+
$pdf->addEmptySignatureAppearance(posx: 100, posy: 90, width: 90, height: 35, page: $page2['pid'], name: 'Reviewer');
218+
$pdf->addEmptySignatureAppearance(posx: 100, posy: 135, width: 90, height: 35, page: $page2['pid'], name: 'Manager');
219219

220220
// -----------------------------------------------------------------------
221221
// Page 3 – Workflow guide

examples/E075_external_signature_injection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
posx: $sigPosX,
6868
posy: $sigPosY,
6969
width: $sigWidth,
70-
heigth: $sigHeight,
70+
height: $sigHeight,
7171
page: $page['pid'],
7272
name: 'Remote Approval',
7373
);

examples/E076_absolute_position.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
$pdf->setAuthor('Nicola Asuni');
3030
$pdf->setSubject('tc-lib-pdf example: 076');
3131
$pdf->setTitle('Minimal Example');
32-
$pdf->setKeywords('TCPDF tc-lib-pdf absolute positon');
32+
$pdf->setKeywords('TCPDF tc-lib-pdf absolute position');
3333
$pdf->setPDFFilename('076_absolute_position.pdf');
3434

3535
// Line style

src/AFRelationship.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
/**
66
* AFRelationship.php
77
*
8-
* @since 2026-07-17
9-
* @category Library
10-
* @package Pdf
11-
* @author Nicola Asuni <info@tecnick.com>
12-
* @copyright 2002-2026 Nicola Asuni - Tecnick.com LTD
13-
* @license https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
14-
* @link https://github.com/tecnickcom/tc-lib-pdf
8+
* @since 2026-07-17
9+
* @category Library
10+
* @package Pdf
11+
* @author Nicola Asuni <info@tecnick.com>
12+
* @copyright 2002-2026 Nicola Asuni - Tecnick.com LTD
13+
* @license https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
14+
* @link https://github.com/tecnickcom/tc-lib-pdf
1515
*
1616
* This file is part of tc-lib-pdf software library.
1717
*/
@@ -26,13 +26,13 @@
2626
* Backed enum for the PDF/A-3 embedded file /AFRelationship value, as validated
2727
* by JavaScript::addEmbeddedFile().
2828
*
29-
* @since 2026-07-17
30-
* @category Library
31-
* @package Pdf
32-
* @author Nicola Asuni <info@tecnick.com>
33-
* @copyright 2002-2026 Nicola Asuni - Tecnick.com LTD
34-
* @license https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
35-
* @link https://github.com/tecnickcom/tc-lib-pdf
29+
* @since 2026-07-17
30+
* @category Library
31+
* @package Pdf
32+
* @author Nicola Asuni <info@tecnick.com>
33+
* @copyright 2002-2026 Nicola Asuni - Tecnick.com LTD
34+
* @license https://www.gnu.org/copyleft/lesser.html GNU-LGPL v3 (see LICENSE)
35+
* @link https://github.com/tecnickcom/tc-lib-pdf
3636
*/
3737
enum AFRelationship: string
3838
{

src/Base.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -745,12 +745,12 @@ abstract class Base
745745
public ObjImage $image;
746746

747747
/**
748-
* Time is seconds since EPOCH when the document was created.
748+
* Time in seconds since EPOCH when the document was created.
749749
*/
750750
protected int $doctime = 0;
751751

752752
/**
753-
* Time is seconds since EPOCH when the document was modified.
753+
* Time in seconds since EPOCH when the document was modified.
754754
*/
755755
protected int $docmodtime = 0;
756756

@@ -813,7 +813,7 @@ abstract class Base
813813
* False = LTR = Left-To-Right.
814814
* True = RTL = Right-To-Left.
815815
*
816-
* @val bool
816+
* @var bool
817817
*/
818818
protected bool $rtl = false;
819819

@@ -822,7 +822,7 @@ abstract class Base
822822
* False = LTR = Left-To-Right.
823823
* True = RTL = Right-To-Left.
824824
*
825-
* @val bool
825+
* @var bool
826826
*/
827827
protected bool $tmprtl = false;
828828

@@ -883,7 +883,7 @@ abstract class Base
883883
];
884884

885885
/**
886-
* Ration for small font.
886+
* Ratio for small font.
887887
*
888888
* @var float
889889
*/
@@ -897,7 +897,7 @@ abstract class Base
897897
protected const FONT_MONO = 'courier';
898898

899899
/**
900-
* Default eference values for unit conversion.
900+
* Default reference values for unit conversion.
901901
*
902902
* @var TRefUnitValues
903903
*/
@@ -1067,14 +1067,14 @@ abstract class Base
10671067
protected array $embeddedfiles = [];
10681068

10691069
/**
1070-
* Annotations indexed bu object IDs.
1070+
* Annotations indexed by object IDs.
10711071
*
10721072
* @var array<int, TAnnot>
10731073
*/
10741074
protected array $annotation = [];
10751075

10761076
/**
1077-
* Array containing the regular expression used to identify withespaces or word separators.
1077+
* Array containing the regular expression used to identify whitespaces or word separators.
10781078
*
10791079
* @var array{
10801080
* r: string,
@@ -1094,7 +1094,7 @@ abstract class Base
10941094
protected string $pdffilename;
10951095

10961096
/**
1097-
* Raw encoded fFile name of the PDF document.
1097+
* Raw encoded File name of the PDF document.
10981098
*/
10991099
protected string $encpdffilename;
11001100

@@ -1297,7 +1297,7 @@ abstract class Base
12971297
protected bool $defPageContentEnabled = false;
12981298

12991299
/**
1300-
* Default font for defautl page content.
1300+
* Default font for default page content.
13011301
*
13021302
* @var ?TFontMetric
13031303
*/
@@ -1324,7 +1324,7 @@ abstract class Base
13241324
/**
13251325
* Default values for cell boundaries.
13261326
*
1327-
* @const TCellBound
1327+
* @var TCellBound
13281328
*/
13291329
public const ZEROCELLBOUND = [
13301330
'T' => 0.0,
@@ -1336,7 +1336,7 @@ abstract class Base
13361336
/**
13371337
* Default values for cell.
13381338
*
1339-
* @const TCellDef
1339+
* @var TCellDef
13401340
*/
13411341
public const ZEROCELL = [
13421342
'margin' => self::ZEROCELLBOUND,

0 commit comments

Comments
 (0)