Skip to content

Accessibility (PDF/UA)

Pro — Commercial License Required
PDF/UA accessibility features require the Pro package.

TCPDF-Next Pro provides full PDF/UA (ISO 14289-2) support for creating accessible PDF documents that work with screen readers and assistive technologies.

Enabling Tagged PDF

php
use Yeeefang\TcpdfNext\Core\Document;

$pdf = Document::create()
    ->setTaggedPdf(true)
    ->setLanguage('en-US');

Structure Tree

The StructureTreeManager automatically builds the document structure tree as you use structure tags:

php
$pdf->openTag('H1')
    ->cell(0, 10, 'Annual Report 2026', newLine: true)
    ->closeTag('H1')

    ->openTag('P')
    ->multiCell(0, 6, 'This report provides an overview...')
    ->closeTag('P');

Supported Structure Elements

ElementPurpose
DocumentRoot structure element
Part, SectDocument sections
H1 -- H6Headings
PParagraph
Table, TR, TH, TDTable structure
L, LIList structure
FigureImages and diagrams
LinkHyperlinks
SpanInline content

Role Mapping

Map custom tag names to standard PDF structure types:

php
$pdf->setRoleMap([
    'invoice-header' => 'H1',
    'line-item' => 'TR',
    'summary' => 'P',
]);

Alt Text for Images

php
$pdf->image('/path/to/chart.png', 10, 10, 100, 80, alt: 'Revenue chart showing Q1-Q4 growth');

Combined PDF/A-4 + PDF/UA

For maximum compliance, combine archival and accessibility:

php
$pdf = Document::create()
    ->enablePdfA(PdfAVersion::A4)
    ->setTaggedPdf(true)
    ->setLanguage('en-US');

Released under the LGPL-3.0-or-later License.