Skip to content

chore(deps): bump tecnickcom/tcpdf from 6.11.2 to 7.0.4 - #7041

Open
dependabot[bot] wants to merge 1 commit into
4.4from
dependabot/composer/tecnickcom/tcpdf-7.0.4
Open

chore(deps): bump tecnickcom/tcpdf from 6.11.2 to 7.0.4#7041
dependabot[bot] wants to merge 1 commit into
4.4from
dependabot/composer/tecnickcom/tcpdf-7.0.4

Conversation

@dependabot

@dependabot dependabot Bot commented on behalf of github Aug 9, 2026

Copy link
Copy Markdown
Contributor

Bumps tecnickcom/tcpdf from 6.11.2 to 7.0.4.

Changelog

Sourced from tecnickcom/tcpdf's changelog.

7.0.0 (2026-06-18) [BREAKING CHANGE]

  • TCPDF IS DEPRECATED AND IN MAINTENANCE-ONLY MODE
  • TCPDF is now a compatibility facade over the modern tecnickcom/tc-lib-pdf engine. It does not reproduce legacy output exactly, and some methods are adapters, shims, or no-ops (see MAPPING.md); both new and existing projects are encouraged to migrate to tecnickcom/tc-lib-pdf.
    • The TCPDF class no longer contains its own PDF engine; every public method delegates rendering to \Com\Tecnick\Pdf\Tcpdf, while a small internal state layer reproduces the legacy cursor/page model (X/Y, margins, fonts, colors, automatic page breaks, headers/footers).
    • The public API is unchanged: all 291 public method signatures (names, parameters, defaults) match legacy TCPDF, so existing integrations keep working.
    • Output is structurally equivalent, not byte-identical: page sizes and content match, but the modern engine's line-breaking and font metrics can differ slightly (long flowing documents may paginate one page earlier or later).
    • Per-method delegation status is documented in MAPPING.md (delegated, adapter, shim, intentional-noop, blocked), machine-verified against the class.
  • tecnickcom/tc-lib-pdf is now a required Composer dependency; the engine and font assets are resolved from vendor/.
  • Minimum PHP version raised to 8.2 (was 7.1).
  • Bundled engine sources removed (include/, tcpdf_fonts.php, tcpdf_font_data.php, tcpdf_images.php, tcpdf_static.php, tcpdf_barcodes_1d.php, tcpdf_barcodes_2d.php); these capabilities are now provided by the tc-lib-* libraries.
  • Font loading migrated to tecnickcom/tc-lib-pdf-font assets resolved via Composer.
    • Install dependencies with Composer so vendor/tecnickcom/tc-lib-pdf-font/target/fonts/ exists.
    • Repository bundled fonts/ assets are removed; use tc-lib font assets or explicit custom font paths.
    • Legacy PHP font descriptors (fontname.php + fontname.z) are no longer supported; convert the original TTF/OTF with the tc-lib-pdf-font importer.
    • Validate all custom font registrations against tc-lib font assets.
  • Tooling: replaced the legacy test harness with a PHPUnit suite under test/, added Mago lint/format configuration, and refreshed CI and Makefile targets (make deps, make fonts, make fonts-rebuild).
  • See README.md for the full migration guide and MAPPING.md for per-method delegation status.

6.11.3 (2026-04-21)

  • Added deprecation notice.
  • Improved composer.json.
  • Added Makefile for common automation tasks.
Commits
  • 7b8de35 fix: handle paths containing spaces in Makefiles
  • f4940b9 chore: update mage and action versions
  • 8d19d26 chore: release 7.0.2
  • 89e6780 deps: set tc-lib-pdf to all 8 versions
  • 4fc5a31 fix: add missing CI dependencies
  • 966b32d BREAKING: v7.0.0 - See README.md and CHANGELOG.md
  • b18f611 bump version
  • 026673b improved composer file
  • b89a4be added deprecation notice
  • 31b80cd improve automation
  • See full diff in compare view

@dependabot dependabot Bot added dependencies Pull requests that update a dependency file php Pull requests that update Php code labels Aug 9, 2026
@ttokoro20240902

Copy link
Copy Markdown
Contributor

TCPDF 7.0.0 は「TCPDF 本体を deprecated とし tecnickcom/tc-lib-pdf への互換ファサードに置き換える」破壊的変更で、納品書PDF に直接効きます。手元で 7.0.4 を入れて検証しました。4.4 での取り込みは見送りを提案します。

決め手は、Text() の直後の Cell()例外もエラーも出さずに消えることです。EC-CUBE は renderShopData()(末尾が lfText() = Text())→ renderTitle()Cell())でこの並びを踏むため、納品書のタイトルが出力から消えました。同梱の helvetica でも再現するので日本語フォント固有ではありません。

$pdf = new TCPDF();
$pdf->AddPage();
$pdf->SetFont('helvetica', '', 12);
$pdf->Text(20, 20, 'TTT');
$pdf->Cell(0, 10, 'AAA', 0, 2, 'C');
// 出力されるテキスト描画   6.11.2 -> TTT, AAA   /   7.0.4 -> TTT のみ

移行自体は可能でした。FPDI は tc-lib-pdf の import API で代替でき、日本語フォントも既存の記述子を変換すれば 6.11.2 と同一のフォント辞書が出ます。ただ 7.0.0 のリリースは 2026-06-18 で、上のように内容が無音で欠ける状態です。6.11.2 に未修正のセキュリティ勧告もなく、急ぐ理由はありません。

提案: このPRは close し、.github/dependabot.yml の composer の ignore に tecnickcom/tcpdfversion-update:semver-major を追加する(symfony/* と同じ形)。以後 6.11.3 が php-production グループで提案されるようになります。

気になっているのは、4.x はメジャー更新なので OrderPdfService extends Fpdi の差し替えのような BC 破壊を入れられるのは 4.4 の今だという点です。見送りでよいか、ご意見をいただけると助かります。

検証の詳細

そのままマージできない理由

  • CI の PHPStan が7件落ちています。$FontFamily / $FontStyle / $FontSizePt / $PageBreakTrigger / checkPageBreak() が 7.0.4 で削除されたためです。前3つは getFontFamily() などで置換できますが、checkPageBreak() は代替がなく書き直しになります。
  • setasign/fpdi v2.6.8 が動作しません。FPDI の TCPDF ブリッジが使う _newobj / _getobj / _enddoc / _getxobjectdict / _putxobjects / $this->n / $this->encrypted / _encrypt_data / $this->PageAnnots が 7.0.4 に1件も存在しません。FPDI 側に対応の動きも見当たりません。

MultiCell の挙動も変わります

折り返し後の getLastH() が 16.08mm(6.11.2)から 5.29mm(7.0.4)になり、Y の進みも 5.4mm ずれます。setFancyTable() は「1度目に文字だけ描いて getLastH() で行の最大高さを取り、2度目にその高さで枠線を描く」作りなので、明細表が破綻します。納品書の座標は #6197 / #6953 で 1mm 単位に詰めてあるため、実測のやり直しも必要です。

なお Text() 単体と Cell() 単体の描画位置は 6.11.2 と完全に一致していました(ずれ 0.000mm)。

フォント資産の梱包について

取り込む場合、EC-CUBE 側でフォント資産を生成・同梱する必要があります。

  • composer install だけでは資産が1つも入らず、new TCPDF()unable to read file: helvetica.json で例外を投げます。tc-lib-pdf-font の配布物に target/fonts/ が含まれていないためです。
  • K_PATH_FONTS の既定値が K_PATH_MAIN . 'vendor/tecnickcom/tc-lib-pdf-font/target/fonts/' ですが、K_PATH_MAIN は tcpdf パッケージ自身のディレクトリなので、composer 環境には存在しないネストパスを指します。
  • upstream 手順の make fonts は「TCPDF がルートプロジェクト」前提のパスで、依存として入れると動きません。
  • 生成される cid0jp は GNU Unifont 由来で顔が1つしかなく、明朝とゴシックを区別できません。既存の kozminproregular.php / kozgopromedium.php(非埋め込みのメトリクスのみ)を tc-lib の JSON へ変換する必要があります。

@ttokoro20240902 ttokoro20240902 self-assigned this Aug 10, 2026
@dotani1111
dotani1111 self-requested a review August 12, 2026 07:31
@dotani1111 dotani1111 added this to the 4.4.0 milestone Aug 12, 2026
Bumps [tecnickcom/tcpdf](https://github.com/tecnickcom/TCPDF) from 6.11.2 to 7.0.4.
- [Changelog](https://github.com/tecnickcom/TCPDF/blob/main/CHANGELOG.TXT)
- [Commits](tecnickcom/TCPDF@6.11.2...7.0.4)

---
updated-dependencies:
- dependency-name: tecnickcom/tcpdf
  dependency-version: 7.0.4
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot
dependabot Bot force-pushed the dependabot/composer/tecnickcom/tcpdf-7.0.4 branch from 2c9f6f9 to 4084bc8 Compare August 12, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants