Skip to content

Commit 054d97e

Browse files
committed
doc: improve documentation and minor code cleanup
1 parent a3f3551 commit 054d97e

8 files changed

Lines changed: 34 additions & 23 deletions

File tree

.github/pull_request_template.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ Please include a summary of the change and include relevant motivation and conte
1212
- [ ] Any new code follows the style guidelines of this project.
1313
- [ ] The code changes have been self-reviewed.
1414
- [ ] Corresponding changes to the documentation have been made.
15-
- [ ] The version has been updated in the VERSION file.
15+
16+
> The maintainer bumps the `VERSION` file at release time. Do not change it in your PR.
1617
1718
## Type of change:
1819

19-
- [ ] Minor non-breaking change (e.g., bug fix, dependencies updates) → The patch number in the VERSION file has been increased.
20-
- [ ] New feature (non-breaking change which adds functionality) → The minor number in the VERSION file has been increased.
21-
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) → The major number in the VERSION file has been increased.
20+
- [ ] Minor non-breaking change (e.g., bug fix, dependencies updates).
21+
- [ ] New feature (non-breaking change which adds functionality).
22+
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected).
2223
- [ ] Automation.
2324
- [ ] Documentation.
2425
- [ ] Example.

CONTRIBUTING.md

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Thank you for your interest in contributing to **tc-lib-pdf** — the modern evo
44

55
Please take a moment to read this guide before opening an issue or pull request.
66

7+
> **Pull requests are restricted to project collaborators.** If you are not a collaborator, please [open an issue](https://github.com/tecnickcom/tc-lib-pdf/issues) instead of a pull request, describing the bug or feature in detail. A maintainer will review it and take it from there.
8+
79
---
810

911
## Table of Contents
@@ -83,7 +85,11 @@ The more precise and reproducible the report, the faster it can be triaged and f
8385

8486
## Submitting a Bug Fix
8587

86-
1. [Fork the repository](https://github.com/tecnickcom/tc-lib-pdf/fork) and create a branch from `main`:
88+
> Only project collaborators can open pull requests. If you are not a collaborator, please [open an issue](https://github.com/tecnickcom/tc-lib-pdf/issues/new) describing the bug in detail (see [Reporting a Bug](#reporting-a-bug)). A maintainer will take it from there.
89+
90+
Collaborators preparing a fix:
91+
92+
1. Create a branch from `main`:
8793
```bash
8894
git checkout -b fix/short-description-of-bug
8995
```
@@ -94,9 +100,7 @@ The more precise and reproducible the report, the faster it can be triaged and f
94100
make qa
95101
```
96102
5. Commit your changes (see [Commit Message Guidelines](#commit-message-guidelines)).
97-
6. Open a pull request against `main` and fill in the PR template:
98-
- Describe the problem and your solution.
99-
- Reference the related issue number (e.g. `Fixes #123`).
103+
6. Open a pull request against `main` and fill in the PR template, describing the problem and your solution and referencing the related issue number (e.g. `Fixes #123`).
100104

101105
---
102106

@@ -107,7 +111,7 @@ Before writing any code:
107111
1. **Open a Feature Request** on [GitHub Issues](https://github.com/tecnickcom/tc-lib-pdf/issues/new) describing the use case and proposed API.
108112
2. Wait for feedback from the maintainer. This avoids investing time in a direction that may not be accepted.
109113

110-
Once the feature is agreed upon, follow the same branch → code → test → PR workflow as for bug fixes, using a branch named `feature/short-description`.
114+
Once the feature is agreed upon, a collaborator will implement it following the same branch → code → test → pull request workflow as for bug fixes, using a branch named `feature/short-description`.
111115

112116
---
113117

@@ -163,6 +167,9 @@ Coverage reports are generated in `target/coverage/`.
163167

164168
## Pull Request Guidelines
165169

170+
> Opening pull requests is restricted to project collaborators. If you are an external contributor, please [open an issue](https://github.com/tecnickcom/tc-lib-pdf/issues/new) describing the problem or feature in detail instead.
171+
172+
- **Sign the Contributor License Agreement (CLA).** On your first pull request the CLA Assistant bot will comment with a link to sign; the PR cannot be merged until the CLA is signed.
166173
- Target the `main` branch.
167174
- Keep PRs focused — one fix or feature per PR.
168175
- Ensure `make qa` passes locally before opening the PR.

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8.65.0
1+
8.65.1

doc/DIGITAL_SIGNATURES.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,8 @@ When LTV is enabled the output PDF contains `/DSS`, `/VRI`, `/OCSPs`, `/CRLs`, a
7373

7474
```bash
7575
openssl req -x509 -nodes -days 3650 -newkey rsa:2048 \
76-
-keyout tcpdf.key -out tcpdf.crt
76+
-keyout tcpdf.key -out tcpdf.crt \
77+
-subj "/CN=tc-lib-pdf test certificate"
7778
# convert to PKCS#12 if needed
7879
openssl pkcs12 -export -in tcpdf.crt -inkey tcpdf.key -out tcpdf.p12
7980
```

examples/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This index lists all runnable examples bundled with tc-lib-pdf, from foundationa
55
- [E000_overview.php](E000_overview.php): General feature overview with text, graphics, HTML, SVG, images, barcodes, transparency, gradients, annotations, and bookmarks.
66
- [E001_invoice.php](E001_invoice.php): Invoice layout example with embedded Factur-X / ZUGFeRD metadata.
77
- [E002_font_dump.php](E002_font_dump.php): Font inspection and glyph dump example.
8-
- [E003_rtl_languages.php](E003_rtl_languages.php): Right-To-Left (RTL) text rendering example for Persian, Arabic and Hebrew.
8+
- [E003_rtl_languages.php](E003_rtl_languages.php): Right-To-Left (RTL) text rendering example for Persian, Arabic, and Hebrew.
99
- [E004_page_formats.php](E004_page_formats.php): Page format and orientation samples.
1010
- [E005_header_footer.php](E005_header_footer.php): Repeating custom page header and footer example with PDF/UA Artifact tagging (`Pagination/Header` and `Pagination/Footer`).
1111
- [E006_minimal.php](E006_minimal.php): Minimal "Hello, PDF" setup.
@@ -48,7 +48,7 @@ This index lists all runnable examples bundled with tc-lib-pdf, from foundationa
4848
- [E043_html_tables.php](E043_html_tables.php): HTML table layout showcase including colspan/rowspan, nested tables, and CSS styling.
4949
- [E044_toc_index.php](E044_toc_index.php): Bookmark outline example with generated table of contents via addTOC.
5050
- [E045_encryption_and_permissions.php](E045_encryption_and_permissions.php): PDF encryption and permission controls with user and owner passwords.
51-
- [E046_pangrams.php](E046_pangrams.php): Multilingual pangram showcase covering 14 scripts: Latin, Arabic, Hebrew, Thai, Devanagari, Hangul, Greek, Japanese, Russian, Armenian, Georgian, Tamil, Bengali, Amharic, Khmer, Tibetan, and Chinese.
51+
- [E046_pangrams.php](E046_pangrams.php): Multilingual pangram showcase covering 17 scripts: Latin, Arabic, Hebrew, Thai, Devanagari, Hangul, Greek, Japanese, Russian, Armenian, Georgian, Tamil, Bengali, Amharic, Khmer, Tibetan, and Chinese.
5252
- [E047_remote_resources_security.php](E047_remote_resources_security.php): Remote resource security configuration using fileOptions host/path allowlists, size limits, and cURL controls.
5353
- [E048_page_boxes_prepress.php](E048_page_boxes_prepress.php): Prepress page-box guide showing Media/Crop/Bleed/Trim/Art boundaries with visual overlays.
5454
- [E049_output_targets_integration.php](E049_output_targets_integration.php): Multi-target output example covering render, download, save-to-file, and MIME attachment workflows.
@@ -78,7 +78,7 @@ This index lists all runnable examples bundled with tc-lib-pdf, from foundationa
7878
- [E073_css_supported_categories.php](E073_css_supported_categories.php): Consolidated CSS category showcase covering cascade, selectors, box model, typography, float/clear/position, tables, and paged media.
7979
- [E074_text_cell_fit_modes.php](E074_text_cell_fit_modes.php): Visual inspection grid for getTextCell() fit modes (T, S, F) including disabled precondition cases.
8080
- [E075_external_signature_injection.php](E075_external_signature_injection.php): External/remote signing walkthrough using signature placeholder setup, ByteRange digest export, and injected CMS/PKCS#7 signature bytes.
81-
- [E076_absolute_position.php](E076_absolute_position.php): Absolute coordinates position inside a give page.
81+
- [E076_absolute_position.php](E076_absolute_position.php): Absolute coordinate positioning within a given page.
8282
- [E077_html_table_header_px_unit.php](E077_html_table_header_px_unit.php): HTML table pagination with px document units, verifying replayed header rows keep the same column geometry on continuation pages.
8383
- [E078_htmlcell_page_margins.php](E078_htmlcell_page_margins.php): Single page with 100mm top and bottom margins, placing getHTMLCell text blocks in the top border, central content area, and bottom border.
8484
- [E079_font_stretch_spacing_matrix.php](E079_font_stretch_spacing_matrix.php): Font stretching (Tz) and character spacing (Tc) matrix across L/C/R/J alignment for both the direct text API and the HTML/CSS font-stretch/letter-spacing engine.

src/Base.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,7 +701,7 @@ abstract class Base
701701
/**
702702
* TCPDF version.
703703
*/
704-
protected string $version = '8.65.0';
704+
protected string $version = '8.65.1';
705705

706706
/**
707707
* Encrypt object.

src/HTML.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18076,17 +18076,19 @@ protected function parseHTMLTagOPENhr(
1807618076
}
1807718077

1807818078
$lineY = $tpy + ($this->getHTMLLineAdvance($hrc, $key) / 2);
18079-
// A horizontal rule carries no semantics, so in PDF/UA mode its stroke is wrapped
18080-
// as an Artifact (tagPdfUaArtifactContent is a no-op outside PDF/UA mode). Without
18081-
// this the rule would be untagged real content, violating PDF/UA-1 7.1.
18082-
$out .= $this->tagPdfUaArtifactContent($this->graph->getLine($tpx, $lineY, $tpx + $width, $lineY, [
18079+
$lineStyle = [
1808318080
'lineWidth' => $strokeWidth,
1808418081
'lineCap' => 'butt',
1808518082
'lineJoin' => 'miter',
1808618083
'dashArray' => [],
1808718084
'dashPhase' => 0,
1808818085
'lineColor' => $elm['fgcolor'] === '' ? 'black' : $elm['fgcolor'],
18089-
]));
18086+
];
18087+
$outLine = $this->graph->getLine($tpx, $lineY, $tpx + $width, $lineY, $lineStyle);
18088+
// A horizontal rule carries no semantics, so in PDF/UA mode its stroke is wrapped
18089+
// as an Artifact (tagPdfUaArtifactContent is a no-op outside PDF/UA mode). Without
18090+
// this the rule would be untagged real content, violating PDF/UA-1 7.1.
18091+
$out .= $this->tagPdfUaArtifactContent($outLine);
1809018092
$this->moveHTMLToNextLine($hrc, $key, $tpx, $tpy, $tpw);
1809118093

1809218094
return $out;

src/Text.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -892,9 +892,9 @@ public function endStructElem(): void
892892
$top = $this->pdfuaStructStack[$topIndex];
893893
unset($this->pdfuaStructStack[$topIndex]);
894894

895-
// Log elements that received marked-content or nested structure children.
896-
// Elements flagged "required" (e.g. table cells) are kept even when empty so
897-
// the table grid stays regular and rows keep their full column count.
895+
// Record elements that picked up marked-content or nested structure children.
896+
// "Required" elements (e.g. table cells) are retained even when empty, so the
897+
// table grid stays uniform and every row keeps its full column count.
898898
if (
899899
$top['kids'] !== []
900900
|| isset($top['annots']) && $top['annots'] !== []

0 commit comments

Comments
 (0)