Skip to content

Right-to-left text is tagged in visual order under PDF/UA, with no ActualText #405

Description

@jakejackson1

On #325 (feature/pdfua-1-support), right-to-left runs are drawn in visual order with no /ActualText and no /ReversedChars, so text extraction and assistive technology read the words reversed.

$mpdf = new \Mpdf\Mpdf(['PDFUA' => true, 'PDFUAauto' => true]);
$mpdf->SetTitle('RTL');
$mpdf->WriteHTML('<p dir="rtl" lang="ar">مرحبا بالعالم</p>');
// pdftotext returns the two words in reverse order

veraPDF doesn't flag this. It still breaks Matterhorn 09-001, where the content order must be the logical order.

Expected. Wrap each RTL run's marked content with /ActualText holding the logical string, or split it into words with /ReversedChars. Shaped Arabic and Indic text also needs /ActualText wherever glyph substitutions lose the characters that ToUnicode can't map.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions