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

Maruan Sahyoun commented on PDFBOX-2252:
----------------------------------------

>From a quick scan the results for bidi text improved a lot as it now seems to 
>correctly handle the mixed text:

govdocs1/302/302975.pdf
before: {{fo: 65 | في: 37 | من: 34 | ot: 33 | أو: 31 | غير: 30 | of: 27 | على: 
22 | عمل: 18 | dna: 18}}
after: {{of: 92 | في: 47 | أو: 45 | من: 45 | to: 42 | and: 28 | على: 28 | غير: 
24 | طبية: 20 | عن: 18}}

commoncrawl2/ZN/ZNWHQ7WJSR3NCQVIHEXAMKZC47LAJURT
before: {{eçkrüt: 1 | شمروتكناشواط: 1 | abak: 1 | ىنامثعناسل: 1}}
after: {{شمروتكناشواط: 1 | kaba: 1 | türkçe: 1 | ىنامثعناسل: 1}}

commoncrawl2/PA/PANWJVU76BPMA4BF2OGO74ZPRLDWGNBA
before: {{يف: 29 | the: 27 | in: 23 | and: 22 | نم: 13 | for: 12 | of: 11 | 
2009: 11 | 2010: 10 | دنع: 10}}
after: {{في: 29 | the: 27 | in: 23 | and: 22 | من: 13 | for: 12 | of: 11 | 
2009: 11 | at: 10 | الوالدة: 10}}

> PDFTextStripper has problem with documents with mixed language directions
> -------------------------------------------------------------------------
>
>                 Key: PDFBOX-2252
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2252
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Text extraction
>    Affects Versions: 1.8.6, 2.0.0
>            Reporter: Amir
>            Assignee: Maruan Sahyoun
>            Priority: Critical
>             Fix For: 2.1.0
>
>         Attachments: BidiMirroring.txt, IsMirroredDeviations.txt, 
> PDFTextStripper-201709271718.patch, PDFTextStripper-201709272018.patch, 
> PDFTextStripper.java.patch, PDFTextStripper.java.patch, atest.pdf, 
> bugzilla867751.pdf, content_diffs.xlsx, overlap.jpg, 
> pdfs_directionality.xlsx, pdfs_directionality3.xlsx, test.pdf, 
> wikipedia_dl_lyric_test.pdf
>
>
> When the input document of PDFTextStripper is a combination of right-to-left 
> and left-to-right languages, the output characters of one language is 
> reversed. 
> A sample bilingual pdf document is attached.
> PDFTextStripper has a variable "isRtlDominant" in "writePage" function, which 
> is defined as follows:     boolean isRtlDominant = rtlCount > ltrCount;
> This class clearly count the number of rtl characters and decide if the whole 
> content should be revered or not. It's not true, it must operate on each 
> word, not the whole document.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to