[
https://issues.apache.org/jira/browse/PDFBOX-5125?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17298224#comment-17298224
]
Tilman Hausherr commented on PDFBOX-5125:
-----------------------------------------
You need to have a look at the source code of ExtractText (look for
"rotationMagic"), it involves more than just a call to a method.
PDFBOX-4371 has an early version of the code, maybe this makes it easier to
understand the concept. But you should still use the code from ExtractText.java
(and delete all you don't need) because it may have improvements and/or bug
fixes that were not in the initial code.
> Slightly slanted line with right side higher than the left confuses
> PDFTextStripper with sortByPosition=true
> ------------------------------------------------------------------------------------------------------------
>
> Key: PDFBOX-5125
> URL: https://issues.apache.org/jira/browse/PDFBOX-5125
> Project: PDFBox
> Issue Type: Bug
> Components: Text extraction
> Affects Versions: 2.0.22
> Reporter: Gábor Stefanik
> Priority: Major
> Attachments: BB-8541-1-ocr.pdf
>
>
> The attached PDF, when run through PDFTextStripper with sortByPosition=true,
> yields improperly ordered text: the beginnings of lines are printed after the
> ends of the same lines, after a superfluous linebreak. There are also some
> additional erroneous linebreaks that do not result in the text reversing,
> like the one in "keretmegállapodásos".
> PDFBox extracts:
> {noformat}
> lőállító eszközök szállítása és kapcsolódó szolgáltatások 2013”
> „Nyomat e
> árgyban lefolytatott központosított közbeszerzési keretmegállapodáso
> s eljárás 2. része
> t
> (Általános Multifunkciós eszközök) eredményeképpen a Beszerző és El
> adó között
> keretmegállapodás jött létre (továbbiakban: KM).{noformat}
> The same PDF opened in Adobe Reader, and all the text in it copied out:
> {noformat}
> „Nyomat előállító eszközök szállítása és kapcsolódó szolgáltatások 2013”
> tárgyban lefolytatott központosított közbeszerzési keretmegállapodásos
> eljárás 2. része
> (Általános Multifunkciós eszközök) eredményeképpen a Beszerző és Eladó között
> keretmegállapodás jött létre (továbbiakban: KM).{noformat}
> (The word "teljesítése" is missing in both extractions due to an OCR error;
> that's an issue with Tesseract an unrelated to this issue.)
> In Firefox (pdf.js), we get:
> {noformat}
> „Nyomatelőállítóeszközökszállításaés
> kapcsolódószolgáltatások2013”tárgybanlefolytatottközpontosítottközbeszerzésikeretmegállapodásoseljárás2.
> része(ÁltalánosMultifunkcióseszközök)eredményeképpena Beszerzőés
> Eladóközöttkeretmegállapodásjöttlétre(továbbiakban:KM).{noformat}
> (The missing spaces are a well-known incompatibility between Tesseract 4.0
> and pdf.js, workarounded in Tesseract 4.1, but the order of the text remains
> correct.)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]