You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Borris Bonafort <bo...@gmail.com> on 2014/09/30 08:57:30 UTC
Regarding Table in PdfBox
Hi ,
How to identify table using PDFBOX . And extract text from it .
Please help me with the idea .
Thanks
Borris
Re: Regarding Table in PdfBox
Posted by Peter Murray-Rust <pm...@cam.ac.uk>.
This is normally completely dependent on heuristics. I estimate that for
scientific documents alone hundreds of person-years have been spent trying
to decode PDF stream into tables. There is not, and will not be a universal
solution.
On Tue, Sep 30, 2014 at 7:57 AM, Borris Bonafort <bo...@gmail.com>
wrote:
> Hi ,
> How to identify table using PDFBOX . And extract text from it .
> Please help me with the idea .
>
> Thanks
> Borris
>
--
Peter Murray-Rust
Reader in Molecular Informatics
Unilever Centre, Dep. Of Chemistry
University of Cambridge
CB2 1EW, UK
+44-1223-763069
Re: Regarding Table in PdfBox
Posted by Martin Schröder <ma...@oneiros.de>.
2014-09-30 9:05 GMT+02:00 Tilman Hausherr <TH...@t-online.de>:
> short answer: you can't, there is no "table" concept in PDF like in HTML
That answer is a bit to short:
If your document is conformant to PDF/A level A, this should be easy.
Otherwise your document knows nothing about tables.
Best
Martin
Re: Regarding Table in PdfBox
Posted by Frank van der Hulst <dr...@gmail.com>.
Hi Borris,
I've been working on that problem for a while, and I'm close to an answer
(actually, 2 answers). Problem is, there's more than 2 questions :) A
program that's clever enough to handle all the permutations of ways to draw
tables will be huge and/or complex.
My first solution works OK for tables where you know beforehand the
position of each column boundary... you don't need anything to delimit one
column from another. It also handles tables that wrap from one page to the
next. (You can get the source from
https://issues.apache.org/jira/browse/PDFBOX-2286).
My second solution (which isn't finished yet) uses graphic lines to
identify the column boundaries. This makes it easier to automatically
extract text from the table. But it doesn't work on tables that span
multiple pages. I suspect that there are tables out there that use
different ways to draw the lines from what my program expects.
So both versions only handle small subsets of what I think is a very large
set of all possible tables. Both have difficulty with subscripts &
superscripts in the text. And text that goes any way other than horizontal,
left to right.
I'm happy to share my source code so someone else can extend it to work
with more types of tables :)
Frank
On Tue, Sep 30, 2014 at 8:05 PM, Tilman Hausherr <TH...@t-online.de>
wrote:
> short answer: you can't, there is no "table" concept in PDF like in HTML
>
> long answer:
> https://stackoverflow.com/questions/3203790/parsing-pdf-
> files-especially-with-tables-with-pdfbox
>
> Tilman
>
> Am 30.09.2014 um 08:57 schrieb Borris Bonafort:
>
> Hi ,
>> How to identify table using PDFBOX . And extract text from it .
>> Please help me with the idea .
>>
>> Thanks
>> Borris
>>
>>
>
Re: Regarding Table in PdfBox
Posted by Tilman Hausherr <TH...@t-online.de>.
short answer: you can't, there is no "table" concept in PDF like in HTML
long answer:
https://stackoverflow.com/questions/3203790/parsing-pdf-files-especially-with-tables-with-pdfbox
Tilman
Am 30.09.2014 um 08:57 schrieb Borris Bonafort:
> Hi ,
> How to identify table using PDFBOX . And extract text from it .
> Please help me with the idea .
>
> Thanks
> Borris
>