[ 
https://issues.apache.org/jira/browse/PDFBOX-3796?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16017671#comment-16017671
 ] 

Yauheni Salopiy commented on PDFBOX-3796:
-----------------------------------------

Hi [~tilman],

Thank You.
We are using Apache Tika for Text Extraction and I was able to apply to pass 
this value to PDFBox through Tika Configuration and it helped.

I see in Apache Tika code a comments like this:

{code:java}
    // True if we should sort text tokens by position
    // (necessary for some PDFs, but messes up other PDFs):
    @Field
    private boolean sortByPosition = false;

...

     /**
     * If true, sort text tokens by their x/y position
     * before extracting text.  This may be necessary for
     * some PDFs (if the text tokens are not rendered "in
     * order"), while for other PDFs it can produce the
     * wrong result (for example if there are 2 columns,
     * the text will be interleaved).  Default is false.
     */
    public void setSortByPosition(boolean sortByPosition) {
        this.sortByPosition = sortByPosition;
    }
{code}

Setting sortByPosition to true fixes this particular problem, but we have a 
very large number of various *.pdf documents.
[~tilman], please, advise based on Your experience what value is less risky for 
*sortByPosition* option.

Thank You in advance!

Best Regards,
Yauheni Salopiy

> Content of different table cells concatenated on text extraction in some cases
> ------------------------------------------------------------------------------
>
>                 Key: PDFBOX-3796
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3796
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Text extraction
>    Affects Versions: 2.0.7, 3.0.0
>            Reporter: Yauheni Salopiy
>              Labels: table, text_extraction
>         Attachments: fdl_relpub_foi_dailyre0313172017_2.0.6.txt, 
> fdl_relpub_foi_dailyre0313172017_3.0.txt, fdl_relpub_foi_dailyre0313172017.pdf
>
>
> Content of different table cells concatenated on text extraction in some 
> cases.
> Please, see in attachments one of the problematic pdf files and plain text 
> files extracted by PDFBox 2.0.6 and 3.0.0 (trunk)
> Snippet from the extracted text containing concatenated text content of 
> different cells:
>  INDIVIDUAL REC{color:#d04437}SJ{color}eanette 
> Bleckle{color:#d04437}y0{color}3/17/2017/



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to