smalot / smalot/pdfparser

'ti' ligature not parsed and/or displayed correctly

Open
#646 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug de-/encoding issue help wanted
Dominant language
PHP
Stars
2.7k
Forks
579
Avg merge
2m
Merged PRs (30d)
1

Description

In fonts such as Calibri, the pair of glyphs 't' and 'i' are encoded as a 'ti' ligature when converted to PDF. However, I don't believe there is actually a code-point for a 'ti' ligature in UTF-8, and since PdfParser tries to convert all extracted text to UTF-8, it shows up as a missing code-point.

Example PDF: What in tarnation.pdf

Considering that trying to copy-paste the text right from the PDF also results in an unknown 'ti' ligature glyph, I'm not sure this issue can be fixed within PdfParser. But the fact that the PDF displays the glyph properly suggests that it may... ? It's possible this might be another Identity-H encoding issue.

The bytes encoding the ligature are (I believe): f480869f

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached What in tarnation.pdf and the reported bytes f480869f, then trace PdfParser's UTF-8 conversion and Identity-H handling. Determine whether the 'ti' ligature can be extracted as meaningful text rather than a missing code point. Done means the example PDF's ligature is handled correctly without breaking other text extraction.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.