smalot / smalot/pdfparser

getText() order of reading table is wrong

Open
#317 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug missing or incomplete functionality
Dominant language
PHP
Stars
2.7k
Forks
579
Avg merge
2m
Merged PRs (30d)
1

Description

Hi,

I have the following pdf file 2019-wk39wo.pdf.

So if I mark the text by hand it does not mark all kind of text elements

921a9c7f-b2a7-4946-8fc7-b76ad6555e67

if I use the function getText(), pdfparser is reading the text in the marked order. And not like the order of the table :(

As you can see here: the II and III is at the end of the array.

array

Is there another solution to read the table in the right order??

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 by reproducing the reported ordering with the linked 2019-wk39wo.pdf and the getText() entry point. Trace how extracted text elements are ordered, then verify that the table is returned in the expected reading order, including the II and III elements.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.