smalot / smalot/pdfparser

How to get table structure and data from PDF?

Open
#131 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

question
Dominant language
PHP
Stars
2.7k
Forks
579
Avg merge
2m
Merged PRs (30d)
1

Description

Dear friends, good day.
I've installed yours perfect library, and it's work fine with sample:

parseFile('document.pdf'); $text = $pdf->getText(); echo $text; ?>

But I meet one trouble, I have table in parsed pdf, I will pleasant if you give me sample code to access table data in pdf using your perfect library. Unfortunately I can't understand how to do this after reading docs on the website.

I am try to use code below to find table in pdf, but receive not structured symbols, what should I do to define table in pdf and get data currently from it?

parseFile($fullfile); $objects=$document->getObjects(); foreach ($objects as $object) { echo $object->getContent(); } ?>

Thanks a lot for help.

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 Parser entry point and the parseFile(), getText(), and getObjects() calls shown in the issue. Check the existing documentation to determine whether table structure is supported; done would be a documented example for accessing table data or a clear explanation of the library's limitation.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 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.